Skip to content

Commit 495785e

Browse files
authored
Merge pull request #7478 from atsareg/fix-ssl-proxy
[8.0] Fix DISET calls with proxy to be used passed as an argument
2 parents 0941096 + 46584c1 commit 495785e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/DIRAC/Core/DISET/private/Transports/SSL/M2Utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def getM2SSLContext(ctx=None, **kwargs):
101101
with tempfile.NamedTemporaryFile(mode="w") as tmpFile:
102102
tmpFilePath = tmpFile.name
103103
tmpFile.write(kwargs["proxyString"])
104+
# Flush, otherwise the file is empty in the subsequent call
105+
tmpFile.flush()
104106
__loadM2SSLCTXProxy(ctx, proxyPath=tmpFilePath)
105107
else:
106108
# Use normal proxy

src/DIRAC/Core/DISET/private/Transports/SSLTransport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def checkSanity(urlTuple, kwargs):
4848
certFile = certTuple[0]
4949
useCerts = True
5050
elif "proxyString" in kwargs:
51-
if not isinstance(kwargs["proxyString"], bytes):
51+
if not isinstance(kwargs["proxyString"], str):
5252
gLogger.error("proxyString parameter is not a valid type", str(type(kwargs["proxyString"])))
5353
return S_ERROR("proxyString parameter is not a valid type")
5454
else:

0 commit comments

Comments
 (0)