Skip to content

Commit 41282b8

Browse files
committed
fix: suppress interactive OpenSSL stdin passphrase prompts during mTLS cert loading fallbacks
1 parent 48f4e26 commit 41282b8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/google-auth/google/auth/aio/transport/mtls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def make_client_cert_ssl_context(
5454
try:
5555
context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
5656
context.load_cert_chain(
57-
certfile=cert_path, keyfile=key_path, password=passphrase_val
57+
certfile=cert_path,
58+
keyfile=key_path,
59+
password=passphrase_val or "",
5860
)
5961
return context
6062
except (ssl.SSLError, OSError, IOError, ValueError, RuntimeError) as exc:

packages/google-auth/google/auth/compute_engine/_mtls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(
120120
self.ssl_context = ssl.create_default_context()
121121
self.ssl_context.load_verify_locations(cafile=mds_mtls_config.ca_cert_path)
122122
self.ssl_context.load_cert_chain(
123-
certfile=mds_mtls_config.client_combined_cert_path
123+
certfile=mds_mtls_config.client_combined_cert_path, password=""
124124
)
125125
super(MdsMtlsAdapter, self).__init__(*args, **kwargs)
126126

0 commit comments

Comments
 (0)