Repository navigation
fix: use PKCS#8 for key serialization and verify PQC TLS 1.3 support - #1501
Merged
Merged
Conversation
hessjcg
approved these changes
Nov 9, 2026
panavenue
force-pushed
the
pqc-python-connector
branch
from
November 11, 2026 01:30
3615c8f to
9b68c4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns key serialization with
GoogleCloudPlatform/alloydb-python-connector#547, verifies and continuously tests hybrid Post-Quantum Cryptography (PQC) TLS 1.3 key exchange (X25519MLKEM768) on OpenSSL 3.5+, and documents PQC runtime requirements inREADME.md.ConnectionInfo.create_ssl_context()already enforcesssl.TLSVersion.TLSv1_3(when supported by OpenSSL) without restricting key-exchange groups, so Python runtimes linked against OpenSSL 3.5+ automatically offer and negotiateX25519MLKEM768(0x11ec).Changes
google/cloud/sql/connector/utils.py&tests/: Switchgenerate_keys()private key serialization from legacy PKCS#1 (TraditionalOpenSSL) to modern algorithm-agnosticPKCS8(-----BEGIN PRIVATE KEY-----), matchingGoogleCloudPlatform/alloydb-python-connector#547, while preserving full backwards compatibility with existing RSA keys andSSLContext.load_cert_chain. Updatetests/conftest.pyandtests/unit/mocks.py(CertificatePublicKeyTypes) accordingly.tests/unit/test_pqc.py&tests/unit/test_utils.py:generate_keys()emits PKCS#8 private keys andSubjectPublicKeyInfopublic keys.ConnectionInfo.create_ssl_context()completes real TLS 1.3 mTLS handshakes with modern PKCS#8 RSA keys, legacy PKCS#1 RSA keys, and ECDSA PKCS#8 keys.X25519MLKEM768(0x11ec) by default on OpenSSL 3.5+, fall back cleanly to classical ECDHE (secp256r1/0x0017viaHelloRetryRequest) against classical-only servers, and honor client-sideOPENSSL_CONFGroupsopt-out..github/workflows/tests.yml: Addunit-pqcCI job runningnox -s unit-3.13inside a digest-pinnedpython:3.13-trixiecontainer (OpenSSL 3.5+), sinceubuntu-latest(24.04) ships OpenSSL 3.0.x.README.md: Add a Post-Quantum Cryptography (PQC) section covering automaticX25519MLKEM768negotiation on OpenSSL 3.5+, checkingssl.OPENSSL_VERSION, classical fallback compatibility, andOPENSSL_CONFopt-out caveats.