diff --git a/src/DIRAC/FrameworkSystem/Utilities/diracx.py b/src/DIRAC/FrameworkSystem/Utilities/diracx.py index 631e4167c3e..1174fce881f 100644 --- a/src/DIRAC/FrameworkSystem/Utilities/diracx.py +++ b/src/DIRAC/FrameworkSystem/Utilities/diracx.py @@ -27,6 +27,8 @@ DEFAULT_TOKEN_CACHE_SIZE = 1024 legacy_exchange_session = requests.Session() +diracxUrl = gConfig.getValue("/DiracX/URL") +legacy_exchange_session.verify = DiracxPreferences(url=diracxUrl).ca_path or True def get_token( diff --git a/src/DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py index d4da3c70735..653a9a8883f 100755 --- a/src/DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py +++ b/src/DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py @@ -126,7 +126,8 @@ def _getFromClient(self, fileId, token, fileSize, fileHelper=None, data=""): gLogger.debug("Uploading sandbox for", res.pfn) files = {"file": ("file", tar_fh)} - response = requests.post(res.url, data=res.fields, files=files, timeout=300) + verify = os.environ.get("DIRACX_CA_PATH", True) + response = requests.post(res.url, data=res.fields, files=files, timeout=300, verify=verify) gLogger.debug("Sandbox uploaded", f"for {res.pfn} with status code {response.status_code}") # TODO: Handle this error better @@ -371,7 +372,8 @@ def _sendToClient(self, fileID, token, fileHelper=None, raw=False): if filePath.startswith("/S3"): with TheImpersonator(credDict, source="SandboxStore") as client: res = client.jobs.get_sandbox_file(pfn=filePath) - r = requests.get(res.url) + verify = os.environ.get("DIRACX_CA_PATH", True) + r = requests.get(res.url, verify=verify) r.raise_for_status() sbData = r.content if fileHelper: