Quelques trucs qui traînent.
This commit is contained in:
parent
d0619adcf6
commit
607a691a88
2 changed files with 4 additions and 4 deletions
|
@ -1855,12 +1855,12 @@ class certificat(Attr):
|
|||
if certificat.startswith('-----BEGIN CERTIFICATE-----'):
|
||||
certificat = ssl.PEM_cert_to_DER_cert(certificat)
|
||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, certificat)
|
||||
except Exception:
|
||||
except Exception as e1:
|
||||
try:
|
||||
certificat = base64.b64decode(certificat)
|
||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, certificat)
|
||||
except Exception:
|
||||
raise ValueError("Format du certificat invalide, est-il bien au format DER ou PEM ?")
|
||||
except Exception as e2:
|
||||
raise ValueError("Format du certificat invalide, est-il bien au format DER ou PEM ? :\nerreur1 : %r, erreur2 : %r" % (e1, e2))
|
||||
data = fetch_cert_info(x509)
|
||||
return (certificat, data)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue