CPython ssl module (and the OpenSSL it links)
Offers X25519MLKEM768 by default whenever the interpreter links OpenSSL 3.5 or later; only Python 3.15 can set or report the negotiated group.
- PyPI
- Version cited
- 3.15.2python.org 3.15.2, 3.14.10 and 3.13.18. The AGY report gives 3.11.18 and 3.12.16 as the latest 3.11/3.12 releases; the Claude report reads installer build scripts at v3.12.13, v3.11.14 and v3.10.19, the latest tags that have installers.
- Downloads
- n/a
Key exchange and encryption
PQ with action
On by default with OpenSSL ≥3.5
Signatures and identity
PQ with action
ML-DSA chains on OpenSSL ≥3.5
What to do
Run every service on an interpreter linked to OpenSSL 3.5.6 or later, delete set_ecdh_curve() calls, and on Python 3.15 log SSLSocket.group() from a health check.
Since 1 Dec 2026 Routine only: OpenSSL 3.5.10 bumps on the 3.14, 3.15 and main branches (gh-162936, Windows 1 Dec; macOS/Android/iOS backports 2 Dec) and CI testing of OpenSSL 3.4 and 3.6 dropped on 2 Dec (PR #162986). No advisory-specific issue, PR or statement as of 3 Dec 2026.
Details
CPython’s ssl module negotiates whatever the OpenSSL linked to its _ssl module offers. With OpenSSL 3.5 or later that is X25519MLKEM768 first, with no code change. With OpenSSL 3.0, 1.1.1 or LibreSSL it is classical only. The TLS page has the full discussion; this record summarizes it.
Status by build#
- OpenSSL ≥3.5 builds python.org 3.13.16+, 3.14.6+ and 3.15.x; uv-managed python-build-standalone (OpenSSL 3.5.10 since
20261201); Homebrew; fresh conda-forge environments; Dockerpython:*-trixieandalpine3.22toalpine3.24images; Debian 13; Ubuntu 25.10, 26.04 and 26.10; RHEL 10.1. The AGY report’s matrix row: on OpenSSL ≥3.5 for 3.13–3.15, Trixie, Alpine 3.22+ and uv. - crypto-policy opt-in RHEL 9.7 (9.8+ per the AGY report), Alma/Rocky 9 and Amazon Linux 2023 (AL2023.12+) ship OpenSSL 3.5 but need
update-crypto-policies --set DEFAULT:PQ. - classical only python.org 3.10–3.12 installers (OpenSSL 1.1.1 / 3.0.x), python.org 3.13.0–3.13.15 and 3.14.0–3.14.5, Docker
bookwormandslim-bookworm, Debian 12, Ubuntu 22.04 and 24.04 (25.04 has OpenSSL 3.4.1), Alpine 3.21 and macOS/usr/bin/python3(3.9.6 with LibreSSL 2.8.3, which negotiated TLS 1.2 with X25519).
The full matrix, with evidence and the points where the reports disagree, is in the build matrix.
Tested behavior#
- Every interpreter linked to OpenSSL 3.5.7, 3.5.9 or 3.6.3 negotiated
kex=X25519MLKEM768with a plainssl.create_default_context(); a 3.10.16 build on OpenSSL 3.0.16 gotkex=X25519(defaults). set_ecdh_curve()resolves names withOBJ_sn2nid(), soset_ecdh_curve('X25519MLKEM768')raisesValueError: unknown elliptic curve name. Called with any curve it runsSSL_CTX_set1_groups(ctx, &nid, 1)and drops PQ, on clients too, although the docs say it “doesn’t apply to client sockets” (kill switch).- One process can hold several OpenSSLs: in a CPython 3.13.5 process,
sslreported 3.6.3 while cryptography 51.0.0 and pyOpenSSL 26.5.1 reported 4.1.1 (ASTRA report). - ML-DSA-65 server certificates verify on 3.15.0 (
server_sigalg=mldsa65) and on 3.14.6; 3.10.16 on OpenSSL 3.0.16 failed withSSLEOFError(certificates).
APIs#
- Python 3.12 to 3.14 expose no group-list or sigalg APIs, only the legacy single-curve
set_ecdh_curve(). - Python 3.15.0 (9 Oct 2026) adds
SSLContext.set_groups(),SSLContext.get_groups()andSSLSocket.group()by Ron Frederick (gh-136306),SSLContext.set_ciphersuites()(gh-137197), andssl.get_sigalgs(),SSLContext.set_client_sigalgs(),set_server_sigalgs(),SSLSocket.client_sigalg()andserver_sigalg()(gh-138252). They raiseNotImplementedErroron older OpenSSL and were not backported to 3.13 or 3.14 (3.15 APIs). - Docs issue gh-154517 says
set_groups()“has no example and never mentions that it supports post-quantum groups”. OPENSSL_CONFGroupsworks on 3.12–3.15, but CPython resetsMinProtocol = TLSv1.3to TLS 1.2, so setctx.minimum_versionin code (recipe).
What to do#
- Check
python -c "import ssl; print(ssl.OPENSSL_VERSION)"in every runtime: 3.5 or later, preferably 3.5.6 or later because of CVE-2026-2673. - The AGY report recommends enforcing
TLSv1_3in code, not justOPENSSL_CONF, and moving production runtimes to Python 3.15+ forset_groups(),SSLSocket.group()andset_*_sigalgs()enforcement and telemetry. - Requiring the hybrid implicitly requires TLS 1.3, since hybrid groups are TLS 1.3-only.
Since 1 Dec#
No CPython or PSF issue, PR or statement reacts to the advisory. The PSF Security Roadmap of 30 Nov already plans a PQC PEP for the 3.16 feature window (May 2027) (PSF).
Full discussion: TLS and interpreters