Skip to content

Commit dbe59b8

Browse files
jumpojoygthiemonge
authored andcommitted
When we failed to load pkcs12 cert print warning
Print actual error when we failed to load pkcs12 cert and falling back to the default implemntation, as exception may not be related to certificate or its format like an issue with wrong methods during cryptography version mismatch *** AttributeError: module 'OpenSSL.crypto' has no attribute 'load_pkcs12' Related-Prod: PRODX-39931 Change-Id: I85c8a615c4f2e08e28939805ae0e9b2028dadaed (cherry picked from commit 96846e7)
1 parent 56e4545 commit dbe59b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

octavia/certificates/manager/barbican.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ def get_cert(self, context, cert_ref, resource_ref=None, check_only=False,
115115
return pkcs12.PKCS12Cert(cert_secret.payload)
116116
except exceptions.UnreadablePKCS12:
117117
raise
118-
except Exception:
118+
except Exception as e:
119+
LOG.warning('Failed to load PKCS12Cert for secret %s with %s',
120+
cert_ref, str(e))
121+
LOG.warning('Falling back to the barbican_legacy implementation.')
119122
# If our get fails, try with the legacy driver.
120123
# TODO(rm_work): Remove this code when the deprecation cycle for
121124
# the legacy driver is complete.

0 commit comments

Comments
 (0)