Skip to content

Auth: Suppress interactive OpenSSL stdin passphrase prompts during certificate loading fallbacks #17412

@nbayati

Description

@nbayati

Determine this is the right repository

  • I determined this is the correct repository in which to report this bug.

Summary of the issue

When Python's standard ssl.SSLContext.load_cert_chain is invoked with malformed private key bytes or encrypted PEM files without an explicit password (password=None), OpenSSL falls back to prompting interactively on stdin:

Enter PEM pass phrase:

This causes automated CI pipelines and local test runners (pytest) to hang indefinitely waiting for terminal input during invalid-credential fallback tests.

It affects compute_engine/_mtls.py and aio/transport/mtls.py.

Proposed Solution

Prevent interactive terminal prompts across all network transports by defaulting password to an empty string when passphrase is None:

ssl_context.load_cert_chain(certfile=cert_path, keyfile=key_path, password=passphrase or "")

Metadata

Metadata

Assignees

Labels

type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions