Commit 53043d20 authored by Vincent Pelletier's avatar Vincent Pelletier

caucase.utils._verifyCertificateChain: Fix support for pyOpenSSL >= 24.3.0

parent eeb71cea
...@@ -420,8 +420,11 @@ def _verifyCertificateChain(cert, trusted_cert_list, crl_list): ...@@ -420,8 +420,11 @@ def _verifyCertificateChain(cert, trusted_cert_list, crl_list):
for trusted_cert in trusted_cert_list: for trusted_cert in trusted_cert_list:
store.add_cert(crypto.X509.from_cryptography(trusted_cert)) store.add_cert(crypto.X509.from_cryptography(trusted_cert))
if crl_list: if crl_list:
if hasattr(crypto, 'CRL'): # pragma: no cover
# BBB: pyOpenSSL < 24.3.0
crl_list = [crypto.CRL.from_cryptography(x) for x in crl_list]
for crl in crl_list: for crl in crl_list:
store.add_crl(crypto.CRL.from_cryptography(crl)) store.add_crl(crl)
store.set_flags(crypto.X509StoreFlags.CRL_CHECK) store.set_flags(crypto.X509StoreFlags.CRL_CHECK)
try: try:
crypto.X509StoreContext( crypto.X509StoreContext(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment