Skip to content

Commit 96846e7

Browse files
committed
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
1 parent c8e5e46 commit 96846e7

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
@@ -120,7 +120,10 @@ def get_cert(self, context, cert_ref, resource_ref=None, check_only=False,
120120
return pkcs12.PKCS12Cert(cert_secret.payload)
121121
except exceptions.UnreadablePKCS12:
122122
raise
123-
except Exception:
123+
except Exception as e:
124+
LOG.warning('Failed to load PKCS12Cert for secret %s with %s',
125+
cert_ref, str(e))
126+
LOG.warning('Falling back to the barbican_legacy implementation.')
124127
# If our get fails, try with the legacy driver.
125128
# TODO(rm_work): Remove this code when the deprecation cycle for
126129
# the legacy driver is complete.

0 commit comments

Comments
 (0)