Skip to content

Commit

Permalink
Merge pull request #7478 from atsareg/fix-ssl-proxy
Browse files Browse the repository at this point in the history
[8.0] Fix DISET calls with proxy to be used passed as an argument
  • Loading branch information
fstagni authored Feb 23, 2024
2 parents 0941096 + 46584c1 commit 495785e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/DIRAC/Core/DISET/private/Transports/SSL/M2Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def getM2SSLContext(ctx=None, **kwargs):
with tempfile.NamedTemporaryFile(mode="w") as tmpFile:
tmpFilePath = tmpFile.name
tmpFile.write(kwargs["proxyString"])
# Flush, otherwise the file is empty in the subsequent call
tmpFile.flush()
__loadM2SSLCTXProxy(ctx, proxyPath=tmpFilePath)
else:
# Use normal proxy
Expand Down
2 changes: 1 addition & 1 deletion src/DIRAC/Core/DISET/private/Transports/SSLTransport.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def checkSanity(urlTuple, kwargs):
certFile = certTuple[0]
useCerts = True
elif "proxyString" in kwargs:
if not isinstance(kwargs["proxyString"], bytes):
if not isinstance(kwargs["proxyString"], str):
gLogger.error("proxyString parameter is not a valid type", str(type(kwargs["proxyString"])))
return S_ERROR("proxyString parameter is not a valid type")
else:
Expand Down

0 comments on commit 495785e

Please sign in to comment.