diff --git a/src/DIRAC/FrameworkSystem/DB/ProxyDB.py b/src/DIRAC/FrameworkSystem/DB/ProxyDB.py index 6cab271d782..818778cef69 100755 --- a/src/DIRAC/FrameworkSystem/DB/ProxyDB.py +++ b/src/DIRAC/FrameworkSystem/DB/ProxyDB.py @@ -535,13 +535,20 @@ def getProxyStrength(self, userDN, userGroup=None, vomsAttr=None): :param vomsAttr: VOMS attr we plan to add on the proxy """ # Look in the cache - retVal = self.__getPemAndTimeLeft(userDN, userGroup, vomsAttr=vomsAttr) + retVal = Registry.getProxyProvidersForDN(userDN) + if retVal["OK"]: - pemData = retVal["Value"][0] - chain = X509Chain() - retVal = chain.loadProxyFromString(pemData) - if retVal["OK"]: - return chain.getStrength() + providers = retVal["Value"] + providers.append("Certificate") + for proxyProvider in providers: + + retVal = self.__getPemAndTimeLeft(userDN, userGroup, vomsAttr=vomsAttr, proxyProvider=proxyProvider) + if retVal["OK"]: + pemData = retVal["Value"][0] + chain = X509Chain() + retVal = chain.loadProxyFromString(pemData) + if retVal["OK"]: + return chain.getStrength() return retVal @@ -589,7 +596,11 @@ def __getPemAndTimeLeft(self, userDN, userGroup=None, vomsAttr=None, proxyProvid result = chain.loadProxyFromString(record[0]) if not result["OK"]: return result - result = chain.generateProxyToString(record[1], diracGroup=userGroup, rfc=True) + result = chain.getStrength() + if not result["OK"]: + return result + strength = result["Value"] + result = chain.generateProxyToString(record[1], diracGroup=userGroup, strength=strength, rfc=True) if not result["OK"]: return result return S_OK((result["Value"], record[1]))