diff --git a/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py b/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py index c3ab600661a..5e943da7f41 100644 --- a/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py +++ b/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py @@ -10,7 +10,7 @@ import os import requests -from DIRAC.Core.Security.Locations import getCAsLocation +from DIRAC.Core.Security.Locations import getCAsLocation, getProxyLocation from DIRAC.Resources.Storage.OccupancyPlugins.WLCGAccountingJson import WLCGAccountingJson @@ -39,11 +39,11 @@ def _downloadJsonFile(self, occupancyLFN, filePath): :param filePath: destination path for the file """ - try: with open(filePath, "w") as fd: caPath = getCAsLocation() - res = requests.get(occupancyLFN, verify=caPath) + userProxy = getProxyLocation() + res = requests.get(occupancyLFN, cert=userProxy, verify=caPath) res.raise_for_status() fd.write(res.text) except Exception as e: