File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
src/DIRAC/FrameworkSystem/scripts Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -267,15 +267,12 @@ def loginWithCertificate(self):
267
267
chain = X509Chain ()
268
268
# Load user cert and key
269
269
result = chain .loadChainFromFile (self .certLoc )
270
+ if result ["OK" ]:
271
+ result = chain .loadKeyFromFile (self .keyLoc , password = getpass .getpass ("Enter Certificate password:" ))
270
272
if not result ["OK" ]:
271
- return S_ERROR (f"Can't load { self .certLoc } : { result ['Message' ]} " )
272
- result = chain .loadKeyFromFile (self .keyLoc , password = getpass .getpass ("Enter Certificate password:" ))
273
- if not result ["OK" ]:
274
- if "bad decrypt" in result ["Message" ] or "bad pass phrase" in result ["Message" ]:
275
- return S_ERROR ("Bad passphrase" )
276
- return S_ERROR (f"Can't load { self .keyLoc } : { result ['Message' ]} " )
273
+ return result
277
274
278
- # Remember a clean proxy to then upload it
275
+ # Remember a clean proxy to then upload it in step 2
279
276
proxy = copy .copy (chain )
280
277
281
278
# Create local proxy with group
@@ -288,7 +285,7 @@ def loginWithCertificate(self):
288
285
return S_ERROR ("Cannot contact CS." )
289
286
gConfig .forceRefresh ()
290
287
291
- # Upload proxy to DIRAC server
288
+ # Step 2: Upload proxy to DIRAC server
292
289
return gProxyManager .uploadProxy (proxy )
293
290
294
291
def howToSwitch (self ) -> bool :
You can’t perform that action at this time.
0 commit comments