We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21a38d6 commit db0c4afCopy full SHA for db0c4af
google/cloud/sql/connector/client.py
@@ -234,7 +234,14 @@ async def _get_ephemeral(
234
x509 = load_pem_x509_certificate(
235
ephemeral_cert.encode("UTF-8"), default_backend()
236
)
237
- expiration = x509.not_valid_after_utc
+
238
+ if 'not_valid_after_utc' in x509:
239
+ expiration = x509.not_valid_after_utc
240
+ elif 'not_valid_after' in x509:
241
+ expiration = x509.not_valid_after
242
+ else:
243
+ expiration = datetime.MINYEAR
244
245
# for IAM authentication OAuth2 token is embedded in cert so it
246
# must still be valid for successful connection
247
if enable_iam_auth:
0 commit comments