Hybrid PQ key exchange in Python depends on the linked OpenSSL, not the Python version
Any interpreter linked to OpenSSL 3.5 or later offers X25519MLKEM768 by default, and so do the clients and servers built on it. The remaining work is replacing old builds, removing classical curve pins, configuring each proxy hop and checking the group actually selected.
In short
- Interpreters linked to OpenSSL 3.5 or later negotiated X25519MLKEM768 by default in every test, with no code changes (defaults).
- python.org 3.13.16+, 3.14.6+ and 3.15, uv-managed Pythons, Homebrew, conda-forge and Docker
trixie/alpinequalify; python.org ≤3.12,bookworm, Ubuntu 22.04/24.04 and macOS system Python do not (build matrix). - One
set_ecdh_curve()call, or a classical curve list in a proxy, silently replaces the hybrid with a single classical group (details). - Only Python 3.15 can set and report groups. Older versions can use
OPENSSL_CONF, but CPython resets itsMinProtocolto TLS 1.2 (recipes). - Python servers on OpenSSL 3.5+ negotiate the hybrid, except granian. Envoy and AWS ALB need configuration, and each proxy-to-app hop is a separate handshake (servers, proxies).
- The hybrid needs no new certificates and adds 2.2 KiB per handshake. Python verifies ML-DSA chains on OpenSSL 3.5+, but they add about 13 KiB and no public CA issues them (certificates, wire cost).
OpenSSL 3.5 and later put X25519MLKEM768 first by default#
OpenSSL 3.5 introduced native TLS hybrid groups and changed the default client key shares to X25519MLKEM768 plus classical X25519. The compiled-in group list in 3.5 and 3.6 is "?*X25519MLKEM768 / ?*X25519:?secp256r1 / ?X448:?secp384r1:?secp521r1 / ?ffdhe2048:?ffdhe3072", where * marks a predicted key share (openssl-3.5 t1_lib.c). OpenSSL 4.0 and 4.1.1 add SecP256r1MLKEM768 and curveSM2MLKEM768 to the first tier.
Every interpreter linked to OpenSSL 3.5.7, 3.5.9 or 3.6.3 negotiated kex=X25519MLKEM768 with a plain ssl.create_default_context() against Cloudflare’s PQ test endpoint in live tests on 3 Dec. A Python 3.10.16 build on OpenSSL 3.0.16 negotiated kex=X25519. macOS /usr/bin/python3 3.9.6 (LibreSSL 2.8.3) negotiated TLS 1.2 with X25519 Claude.
RFC 10024 defines three hybrids, for TLS 1.3 only: X25519MLKEM768 (group 4588), SecP256r1MLKEM768 (4587) and SecP384r1MLKEM1024 (4589, 0x11ED). SecP384r1MLKEM1024 is implemented from OpenSSL 3.5 but sits in no default list, so deployments that need it must configure it (FIPS and CNSA 2.0). The IANA registry marks X25519Kyber768Draft00 obsolete; do not count it as the final RFC group.
VersionsOpenSSL branches and default group lists on 3 Dec 2026
| Branch | Latest release | Support | Hybrid in the default list |
|---|---|---|---|
| 3.0 | 3.0.22 (last public) | EOL Sept 2026 | No PQC, no X25519MLKEM768 |
| 3.4 | EOL | No | |
| 3.5 LTS | 3.5.10 (1 Dec 2026) | Supported to Apr 2030 | X25519MLKEM768 first; first native PQC LTS (ML-KEM, ML-DSA, SLH-DSA) |
| 3.6 | EOL | Same list as 3.5 | |
| 4.0 | 4.0.4 (1 Dec 2026) | Adds SecP256r1MLKEM768 and curveSM2MLKEM768 | |
| 4.1 | 4.1.1 (1 Dec 2026) | As 4.0 |
The OpenSSL 4.0 and 4.1.1 default list (openssl-4.1.1 t1_lib.c):
"?*X25519MLKEM768:?SecP256r1MLKEM768:?curveSM2MLKEM768 / ?*X25519:?secp256r1 / ?X448:?secp384r1:?secp521r1 / ?curveSM2 / ?ffdhe2048:?ffdhe3072"
- With the
*entries a client sends two key shares by default: X25519MLKEM768 and X25519. The AGY report quotes this list truncated, as"?*X25519MLKEM768:?SecP256r1MLKEM768:?curveSM2MLKEM768 / ?*X25519:?secp256r1 / ...". - SecP384r1MLKEM1024 (RFC 10024
0x11ED) is supported in 3.5+ and 4.x but not inDEFAULT. Environments that need a CNSA 2.0 or X25519-free hybrid must configure it. The AGY report adds that X25519MLKEM768 stays secure through its ML-KEM-768 component even if X25519 were broken; the argument is on the reading page, and wire sizes for all three groups are on Responses. - OpenSSL 4.0 and 4.1 also add AVX-512/x86_64 NTT and SHAKE x4 PQC speedups and remove deprecated EC curves and ENGINEs (AGY report).
- OpenSSL 4.1.1, 4.0.4 and 3.5.10 were routine security releases on 1 Dec, not reactions to the advisory (OpenSSL 4.1.1, OpenSSL releases).
- The Claude report lists OpenSSL 3.0, 3.4 and 3.6 as end of life. CPython stopped CI-testing 3.4 and 3.6 on 2 Dec (cpython PR #162986).
- RFC 10024, “Post-Quantum Traditional Hybrid Key Agreement for TLS 1.3”, was published in Aug 2026 (rfc-editor.org).
Edge casesa larger ClientHello and CVE-2026-2673
- Larger ClientHello. OpenSSL documents that the predicted X25519MLKEM768 share can make the ClientHello too large for one TCP segment, and “firewall software may erroneously disrupt the TLS handshake”. Prefixing
?X25519MLKEM768without*defers the PQ share to a HelloRetryRequest (SSL_CTX_set1_curves.pod). - The AGY report puts that ClientHello at about 1.3–1.5 KB when offering X25519MLKEM768 plus X25519, split across two TCP packets. Broken corporate DPI proxies or firewalls that drop fragmented ClientHellos can cause silent hangs after moving Docker images to
slim-trixieor enabling uv’s PQ TLS (astral-sh/uv#12174) AGY. - CVE-2026-2673. A hybrid-group negotiation bug in OpenSSL 3.5/3.6 was fixed in 3.5.6, so prefer 3.5.6 or later. This comes from secondary sources (ALAS-2026-1522).
Your Python build, not your Python version, decides whether the hybrid is on#
python.org 3.13.16+, 3.14.6+ and 3.15, uv-managed Pythons, Homebrew, conda-forge, Docker trixie and alpine images, Debian 13, Ubuntu 26.04 and RHEL 10.1 link OpenSSL 3.5 or later and offer the hybrid by default. python.org 3.10 to 3.12, older 3.13 and 3.14 patch releases, Docker bookworm, Debian 12, Ubuntu 22.04/24.04 and macOS /usr/bin/python3 do not. RHEL 9.7 and Amazon Linux 2023 ship OpenSSL 3.5 but keep PQ off until an admin sets DEFAULT:PQ.
The Python version itself is not the blocker. Python 3.10–3.12 built against OpenSSL 3.5+ also get the hybrid: Docker python:3.11-trixie and python:3.12-alpine3.24, conda-forge and fresh python-build-standalone builds. The blockers are the python.org binaries for old branches and old distros. What 3.10–3.14 lack is only the API to control and observe groups (3.15 APIs).
Check web servers, workers, cron jobs, CI images, Lambda and container bases and developer machines: python -c "import ssl; print(ssl.OPENSSL_VERSION)" must report 3.5 or later, preferably 3.5.6 or later. Upgrades do not reach existing installs. An already-installed uv-managed 3.10.16 still reported OpenSSL 3.0.16, so run uv python upgrade or reinstall; an old conda base environment with OpenSSL 3.1.2 offered no ML-KEM.
| Build | OpenSSL on 3 Dec 2026 | Hybrid by default |
|---|---|---|
| python.org 3.15.0–3.15.2 | 3.5.9 | yes |
| python.org 3.14.6–3.14.10 | 3.5.7, then 3.5.9 | yes |
| python.org 3.14.0–3.14.5 | 3.0.18–3.0.20 | upgrade to 3.14.6+ |
| python.org 3.13.16–3.13.18 | 3.5.9 | yes |
| python.org 3.13.15 and earlier | 3.0.21 | upgrade to 3.13.16+ |
| python.org 3.10, 3.11, 3.12 | 1.1.1 or 3.0.x | no installers coming |
| uv / python-build-standalone | 3.5.10 (20261201) |
fresh installs |
Homebrew python@3.12–@3.15 |
3.5.10 or 4.1.1 | yes |
| conda-forge | 3.5 pin, up to 4.1.1 | fresh environments |
Docker python:*-trixie, unpinned *-slim |
3.5.9 | every Python version |
Docker python:*-alpine3.22 to 3.24 |
3.5.10 | yes |
Docker python:*-bookworm |
3.0.x | move to trixie |
| Debian 13; Ubuntu 25.10, 26.04, 26.10 | 3.5.3 to 4.0.3 | yes |
| Debian 12; Ubuntu 22.04, 24.04, 25.04; Alpine 3.21 | 3.0.x to 3.4.1 | no |
| RHEL 9.7+, Alma/Rocky 9, Amazon Linux 2023 | 3.5 | set DEFAULT:PQ |
| RHEL 10.1+ | 3.5 | all policies |
macOS /usr/bin/python3 3.9.6 |
LibreSSL 2.8.3 | TLS 1.2, X25519 |
Tablethe full build matrix with evidence
| Python source | OpenSSL linked (3 Dec 2026) | X25519MLKEM768 by default | Evidence and notes |
|---|---|---|---|
| python.org installers 3.15.0–3.15.2 (Windows, macOS) | 3.5.9 | Yes | Build scripts at each tag (build-installer.py). AGY: 3.5.10 in 3.15.2 (see below) |
| python.org 3.14.6–3.14.7 | 3.5.7 | Yes | 3.14 Windows moved to 3.5.6 on 16 May 2026 (gh-149254) |
| python.org 3.14.8–3.14.10 | 3.5.9 | Yes | The 3.14.10 embeddable zip’s libcrypto-3.dll reports “OpenSSL 3.5.9 29 Sep 2026” |
| python.org 3.14.0–3.14.5 | 3.0.18–3.0.20 | No | Upgrade to 3.14.6+ |
| python.org 3.13.16–3.13.18 | 3.5.9 | Yes | “gh-158010: Update OpenSSL in binaries and CI from 3.0 to 3.5” (27 Sep 2026) (cpython#158010) |
| python.org 3.13.15 and earlier | 3.0.21 | No | Upgrade to 3.13.16+ |
| python.org 3.12 / 3.11 / 3.10 (build scripts at the latest tags with installers, v3.12.13, v3.11.14, v3.10.19, that is 3.12.13, 3.11.14 and 3.10.19) | 3.0.16 / 3.0.13–3.0.15 / 1.1.1 | No | Source-only branches. There will be no new installers, so use another distribution |
| python.org branch heads (3.14, 3.15, main) | 3.5.10 | Yes (next releases) | Windows gh-162936 on 1 Dec; macOS/Android/iOS backports 2 Dec. Routine bump, not tied to the advisory (commit 8d1db1c32e) |
| uv-managed / python-build-standalone (all versions 3.11–3.15, newly installed) | 3.5.10 since PBS 20261201; 3.5.9 before |
Yes | Static no-shared build reading /etc/ssl/openssl.cnf, on Unix and Windows. Already-installed older builds keep their old OpenSSL (a 3.10.16 install reported 3.0.16), so run uv python upgrade or reinstall (PBS 20261201, PBS #1346, downloads.json) |
Homebrew (python@3.12–3.15) |
python@3.12 and python@3.13 use openssl@3 (3.5.10); python@3.14/@3.15 use openssl@4 (4.1.1) |
Yes | A local Homebrew 3.13.5 on OpenSSL 3.6.3 negotiated X25519MLKEM768 (formulae.brew.sh). python@3.12 is from the AGY report only |
| conda-forge | Global pin openssl 3.5; newest builds up to 4.1.1 |
Yes, for fresh environments | CPython is built against conda’s OpenSSL (unvendored). Old environments stay old: a base env with OpenSSL 3.1.2 offered no ML-KEM (conda-forge pinning) |
Anaconda defaults |
Latest 3.5.9; 3.0.22 builds still published | Yes if resolved to 3.5.x | anaconda.org/anaconda/openssl |
Docker python:*-trixie (incl. latest, 3, 3.15 → 3.15.2-trixie); unpinned python:3.12-slim to 3.15-slim (3.12.16–3.15.2) |
Debian 13: 3.5.9 | Yes, for every Python version, including 3.11 and 3.12 | CPython is compiled against the distro’s libssl (inferred). Unpinned -slim tags now resolve to slim-trixie (docker-library versions.json) |
Docker python:*-alpine3.22 to -alpine3.24 (3.11–3.15) |
3.5.10 (3.5.10-r0) |
Yes | The Claude report lists python:*-alpine3.23 / -alpine3.24 and recommends *-alpine3.23+; the AGY report lists alpine3.22 to 3.24. Older alpine3.21 ships 3.3.7 (pkgs.alpinelinux.org) |
Docker python:*-bookworm / python:*-slim-bookworm (3.11–3.15) |
Debian 12: 3.0.22 (Claude) or 3.0.20 (AGY) | No | Any Dockerfile pinning -bookworm or *-slim-bookworm is classical-only. Move to python:*-slim-trixie or python:*-trixie |
| Docker Windows Server Core (3.14+) | python.org binaries | Follows the python.org rows | |
Debian 13 trixie system python3 (3.13.5) |
3.5.9 | Yes | Debian madison |
Debian 12 bookworm system python3 (3.11.2) |
3.0.x | No | |
| Ubuntu 26.10 / development series | 4.0.3 | Yes | packages.ubuntu.com |
Ubuntu 26.04 LTS (resolute) |
3.5.5 | Yes | |
| Ubuntu 25.10 | 3.5.3 | Yes | AGY report only |
Ubuntu 25.04 (plucky) |
3.4.1 | No | AGY report only |
Ubuntu 22.04 / 24.04 LTS (noble) |
3.0.2 / 3.0.13 | No | The most common LTS server bases |
| RHEL 9.7, Alma/Rocky 9 (Claude); RHEL 9.8+ (AGY) | 3.5.x | No by default. Crypto-policies keep PQ off “to avoid immediate disruption”. Turn it on with update-crypto-policies --set DEFAULT:PQ |
Secondary source (Red Hat blog) |
| RHEL 10.1 (Claude); RHEL 10.2+ (AGY) | 3.5.x | Yes. PQ is on in all predefined policies. NO-PQ disables it; TEST-PQ enables pure ML-KEM |
Secondary source (RHEL 10.1 notes, Oracle Linux 10.1) |
| Amazon Linux 2023 | 3.5 (rebased in 2023.10.20260330) | No by default. Requires AL2023.12+ and sudo update-crypto-policies --set DEFAULT:PQ |
AL2023: Enable PQC |
| Alpine 3.21 | 3.3.7 | No | |
macOS /usr/bin/python3 |
3.9.6 with LibreSSL 2.8.3 | No (TLS 1.2, X25519) | Tested |
System OpenSSL versions for Fedora 43/44, CentOS Stream 9/10 and Debian unstable are in the source-build table on the cryptography page.
Sources disagreepatch levels and bundled OpenSSL versions
- python.org 3.14.10 and 3.15.2. The Claude report found OpenSSL 3.5.9 in the released installers (verified from the 3.14.10 embeddable zip) and 3.5.10 only on branch heads, for the next releases. The AGY report lists 3.13.18 / 3.14.10 / 3.15.2 at 3.5.9 / 3.5.10 / 3.5.10, saying “3.14/3.15 updated to
3.5.10Dec 1 (gh-162936)”. Both agree the hybrid is on. - python.org 3.11 and 3.12. The AGY report gives 3.11.18 and 3.12.16 as the latest releases, linking OpenSSL 3.0.13 and 3.0.16, and says the official Windows/macOS 3.12 installers still bundle EOL OpenSSL 3.0. The Claude report reads the installer build scripts at the latest tags that have them (v3.12.13, v3.11.14, v3.10.19) and treats the branches as source-only, with no new installers. Both: no PQ.
- Debian 12 and
bookwormimages. Claude: 3.0.22 (elsewhere “3.0.17–3.0.22”). AGY: 3.0.20. Both: no PQ. - Alpine images. Claude lists
alpine3.23/3.24at 3.5.10 and recommendsalpine3.23+; its distro table also puts Alpine 3.22+/edge at 3.5.10. AGY listsalpine3.22to3.24at3.5.10-r0. - RHEL. Claude describes RHEL 9.7 (opt-in) and 10.1 (on by default), from secondary sources. AGY describes RHEL 9.8+ (opt-in) and 10.2+ (on). The reports cite different point releases rather than contradicting each other.
Edge casescrypto-policies, python-build-standalone and uv
- RHEL 9.7 and AL2023 (unverified). Crypto-policies override OpenSSL’s built-in list. System
python3there will not offer the hybrid until an admin setsDEFAULT:PQ, unless the application callsset_groups()itself on Python 3.15. - python-build-standalone on RHEL (unverified). A PBS Python reads
/etc/ssl/openssl.cnfrather than/etc/pki/tls/openssl.cnf. It may therefore ignore crypto-policies entirely and get PQ from OpenSSL’s built-in default. - uv prefers system interpreters unless
UV_MANAGED_PYTHON=1is set (uv #23494). The AGY report recommendsuv python installto close the Python 3.12 and Ubuntu 24.04 OpenSSL 3.0 gap on Unix and Windows; uv itself is on the uv page. - Windows python.org builds were not tested live; their status is inferred from the bundled OpenSSL 3.5.9.
Three questions decide what protects a connection#
The ASTRA report splits Python TLS into three questions, each with its own evidence (3.15 SSL reference, OpenSSL group-list semantics):
- Which library runs here? CPython
ssluses the OpenSSL linked to the interpreter’s_sslmodule. Official PyCA wheels statically link their own. pyOpenSSL 26.5.1 requirescryptography>=49,<52and uses PyCA’s binding. Rebuild or redeploy the component that actually terminates the connection. - What can it offer? The library default, unless runtime provider policy, an explicit group list or a TLS 1.2 cap defeats it. A hybrid deliberately keeps a classical component alongside ML-KEM;
X25519MLKEM768is not classicalX25519. - What was selected and authenticated? Only 3.15 can report it, through
SSLSocket.group()and the sigalg accessors. Older Python can inherit new OpenSSL defaults without exposing any reporting API, and a classicalset_ecdh_curve()override can narrow the list.
One process can hold three OpenSSLs. In an isolated CPython 3.13.5 process, ssl reported 3.6.3 while cryptography 51.0.0 and pyOpenSSL 26.5.1 both reported 4.1.1 ASTRA. openssl version in a shell can describe a third build. Upgrading cryptography does not change what CPython’s ssl negotiates.
set_ecdh_curve() silently replaces the hybrid with one classical curve#
Python 3.12 to 3.14 expose no group-list or signature-algorithm API, only the legacy single-curve set_ecdh_curve(), and it cannot select a hybrid. It resolves names with OBJ_sn2nid(), so set_ecdh_curve('X25519MLKEM768') raises ValueError: unknown elliptic curve name (tested on 3.10, 3.13, 3.14 and 3.15). Calling it with any curve disables PQ: on OpenSSL 3 it runs SSL_CTX_set1_groups(ctx, &nid, 1), which replaces the whole group list with one classical curve (Modules/_ssl.c).
The docs still say the setting “doesn’t apply to client sockets” (ssl.rst). In testing, a client that called set_ecdh_curve('prime256v1') dropped from X25519MLKEM768 to kex=P-256 Claude. Any old hardening snippet that pins prime256v1 or secp384r1 therefore turns PQ off, on clients as well as servers.
Cipher settings neither help nor hurt. set_ciphers() affects only pre-1.3 suites, and even 3.15’s set_ciphersuites() does not select key exchange. The same narrowing happens wherever a classical-only list is set explicitly: nginx ssl_ecdh_curve, Traefik curvePreferences, Caddy curves, Envoy ecdh_curves, and pyOpenSSL’s set_tmp_ecdh, which sets a single curve.
Recipefind kill switches in code, dependencies and proxy configs
Run this across your code, installed dependencies and proxy configuration. Any explicit classical-only curve list silently disables X25519MLKEM768.
grep -rn "set_ecdh_curve\|ssl_ecdh_curve\|curvePreferences\|ecdh_curves\|set_tmp_ecdh"
Settings that look related but do not choose the group:
- uvicorn’s
ssl_cipherscallsset_ciphers(), notset_groups()(uvicorn config.py). - requests and urllib3 set no groups; their
ciphers=only affects TLS 1.2 and earlier. - hypercorn’s default ciphers
"ECDHE+AESGCM"apply to TLS 1.2 only.
Python 3.15 is the first version that can set and report groups#
Python 3.15.0, released 9 Oct 2026, adds group, cipher-suite and signature-algorithm APIs (What’s New 3.15, ssl docs). Ron Frederick wrote the three group methods (gh-136306). They were not backported to 3.13 or 3.14, and no backport issue or PR was found, before or after 1 Dec.
| API | Purpose | Needs |
|---|---|---|
SSLContext.set_groups(groups) |
Takes an OpenSSL group-list string (SSL_CTX_set1_groups_list). Supports PQ and finite-field groups and controls which key shares are sent |
|
SSLContext.get_groups(*, include_aliases=False) |
Lists implemented groups, not the configured or negotiated set | OpenSSL 3.5+ |
SSLSocket.group() |
Returns the negotiated group; None before the handshake |
OpenSSL 3.2+ |
SSLContext.set_ciphersuites |
TLS 1.3 cipher suites (gh-137197); does not select key exchange | |
ssl.get_sigalgs, set_client_sigalgs/set_server_sigalgs, SSLSocket.client_sigalg/server_sigalg |
Signature-algorithm control and inspection (gh-138252) | OpenSSL 3.4+ / 3.5+ |
The methods sit behind OpenSSL version guards and raise NotImplementedError on older builds (build guards). get_groups() lists legacy names such as sect163k1 first. Docs issue gh-154517 notes that set_groups() “has no example and never mentions that it supports post-quantum groups”, and that the TLS 1.3 section is silent on “the post-quantum hybrids that are now enabled by default”.
Hybrid groups are TLS 1.3-only. Requiring PQ therefore implicitly requires TLS 1.3, and peers on TLS 1.2 or on OpenSSL older than 3.5 fail the handshake.
Test logset_groups() on 3.15.0 (python-build-standalone, OpenSSL 3.5.9)
set_groups(...) argument |
Negotiated group |
|---|---|
"X25519MLKEM768" |
X25519MLKEM768 |
"X25519MLKEM768:X25519:secp256r1:secp384r1" |
X25519MLKEM768 |
"?*X25519MLKEM768 / ?*X25519:?secp256r1 / ?secp384r1" |
X25519MLKEM768 |
"DEFAULT" |
X25519MLKEM768 |
"X25519:secp256r1" |
x25519 |
Recipes: prefer or require X25519MLKEM768 on every Python version#
On 3.10–3.14 with OpenSSL 3.5+, doing nothing already prefers the hybrid; the only code change is removing set_ecdh_curve(). To require it there, change OpenSSL’s configuration for the whole process with OPENSSL_CONF. On 3.15, call set_groups() on each context, including inside server hooks. The snippets were tested on 3 Dec unless marked otherwise.
Recipea client context that works on every Python version
import ssl
PQ_PREF = "X25519MLKEM768:X25519:secp256r1:secp384r1" # hybrid first, classical fallback (tested)
PQ_ONLY = "X25519MLKEM768" # refuse non-PQ peers (tested)
def pq_client_context(pq_only: bool = False) -> ssl.SSLContext:
if ssl.OPENSSL_VERSION_INFO < (3, 5): # 3.0 / 1.1.1 / LibreSSL cannot do ML-KEM
raise RuntimeError(f"{ssl.OPENSSL_VERSION} has no ML-KEM; use an OpenSSL>=3.5 Python")
ctx = ssl.create_default_context()
if hasattr(ctx, "set_groups"): # Python 3.15+
if pq_only:
ctx.minimum_version = ssl.TLSVersion.TLSv1_3 # hybrid groups are TLS 1.3-only
ctx.set_groups(PQ_ONLY if pq_only else PQ_PREF)
# Python <3.15: nothing to call; OpenSSL>=3.5 default is "?*X25519MLKEM768 / ?*X25519:..."
# NEVER call ctx.set_ecdh_curve(...) - it replaces the group list with one classical curve.
return ctx
ssl.OPENSSL_VERSION_INFO reports LibreSSL’s own version number, so also check the ssl.OPENSSL_VERSION text (not tested). Sources: ssl docs, OpenSSL default list.
Python 3.10 to 3.14: OPENSSL_CONF, with the TLS floor set in code#
Groups in an OPENSSL_CONF file is honored, even by statically linked builds. On PBS 3.14.6 (OpenSSL 3.5.7, static), Groups = secp384r1 produced kex=P-384; on Homebrew 3.13.5 (OpenSSL 3.6.3), Groups = X25519MLKEM768 produced X25519MLKEM768. The AGY report says Groups = ... and SignatureAlgorithms = ... work across Python 3.12–3.15.
MinProtocol = TLSv1.3 does not survive. CPython calls SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION) after OpenSSL reads openssl.cnf, so the floor is silently reset to TLS 1.2 (verified in Modules/_ssl.c for 3.12–3.15 and tested live) AGY. Set ctx.minimum_version = ssl.TLSVersion.TLSv1_3 in code, or list only TLS 1.3 hybrid groups so a TLS 1.2 handshake has no group to negotiate.
OPENSSL_CONF replaces the default openssl.cnf, so distro or crypto-policy sections stop applying unless you copy them in (standard OpenSSL behavior, not re-verified). Whether it affects the OpenSSL statically linked inside cryptography and pyOpenSSL wheels was not determined (OpenSSL group-list man page).
Recipeprefer the hybrid process-wide (Claude report, tested)
# pq.cnf -> OPENSSL_CONF=/path/pq.cnf python app.py
openssl_conf = openssl_init
[openssl_init]
ssl_conf = ssl_sect
[ssl_sect]
system_default = system_default_sect
[system_default_sect]
Groups = X25519MLKEM768:X25519:secp256r1:secp384r1 # or "X25519MLKEM768" to require PQ
Reciperequire hybrids process-wide (AGY report, Python 3.12–3.14 on OpenSSL 3.5+)
CPython overwrites the MinProtocol line, as the file’s own comment warns. The Groups line, which lists only hybrid groups, is what keeps TLS 1.2 out.
# /etc/ssl/pqc-openssl.cnf (export OPENSSL_CONF=/etc/ssl/pqc-openssl.cnf)
openssl_conf = openssl_init
[openssl_init]
ssl_conf = ssl_sect
[ssl_sect]
system_default = system_default_sect
[system_default_sect]
# WARNING: CPython _ssl.c overwrites MinProtocol back to TLSv1.2!
# Either also set ctx.minimum_version = ssl.TLSVersion.TLSv1_3 in Python,
# OR list ONLY TLS 1.3 PQ groups below so TLS 1.2 cannot negotiate any group:
MinProtocol = TLSv1.3
Groups = *X25519MLKEM768:SecP384r1MLKEM1024
Python 3.15: set_groups() in server hooks and client contexts#
uvicorn ≥0.47.0 accepts ssl_context_factory (uvicorn #2920), gunicorn’s gunicorn.conf.py accepts an ssl_context hook (≥21.0), and tornado’s HTTPServer(..., ssl_options=ctx) takes any SSLContext. hypercorn has no hook; subclassing Config and overriding create_ssl_context() is the expected route, untested. In a uvicorn test, a 3.15 client got X25519MLKEM768 and a 3.10/OpenSSL 3.0 client was rejected with SSLEOFError.
For clients, build one 3.15 context with set_groups(...) and pass it in: urllib3.PoolManager(ssl_context=ctx), a requests HTTPAdapter subclass passing ssl_context=ctx in init_poolmanager, httpx.Client(verify=ctx), or aiohttp’s session.get(url, ssl=ctx) or TCPConnector(ssl=ctx) (urllib3 ssl_.py, httpx _config.py). pycurl takes c.setopt(pycurl.SSL_EC_CURVES, "X25519MLKEM768:X25519") (untested).
Recipeuvicorn with the hybrid required (Claude report, tested)
Use uvicorn ≥0.47.0 on Python 3.15.
import ssl, uvicorn
def ssl_context_factory(config, default_factory):
ctx = default_factory() # builds from ssl_certfile/ssl_keyfile/...
ctx.minimum_version = ssl.TLSVersion.TLSv1_3
ctx.set_groups("X25519MLKEM768") # or PQ_PREF to merely prefer
return ctx
uvicorn.run("main:app", port=8443, ssl_certfile="cert.pem", ssl_keyfile="key.pem",
ssl_context_factory=ssl_context_factory)
A string app path plus a callable factory may not work with --workers or reload; the test passed the app object (uvicorn #2920). The ASTRA report’s strict hybrid-only staging canary for the same hook is on the FastAPI page.
Recipeuvicorn with a CNSA-leaning group list and P-384 certificate (AGY report)
# Uvicorn >= 0.47.0 (currently 0.55.0) + Python 3.15+ (if terminating TLS in Python)
import ssl, uvicorn
def pq_ssl_factory(config, default_factory):
ctx = default_factory()
ctx.minimum_version = ssl.TLSVersion.TLSv1_3
if hasattr(ctx, "set_groups"):
ctx.set_groups("X25519MLKEM768:SecP384r1MLKEM1024:secp384r1")
return ctx
config = uvicorn.Config("app:app", ssl_certfile="p384.crt", ssl_keyfile="p384.key", ssl_context_factory=pq_ssl_factory)
Recipegunicorn and hypercorn (untested)
- gunicorn. In
gunicorn.conf.py, definedef ssl_context(conf, default_ssl_context_factory): ctx = default_ssl_context_factory(); ctx.set_groups("X25519MLKEM768:X25519"); return ctx(gunicorn config.py). The AGY report writes the signature asssl_context(config, default_ssl_context_factory). - hypercorn has no groups option or hook (hypercorn config.py). Subclass
Configand overridecreate_ssl_context().
Interpreters stuck on OpenSSL 3.0 can borrow a bundled TLS stack#
The quickest outbound path is pycurl, or urllib3.contrib.pyopenssl.inject_into_urllib3() with a current cryptography wheel. Both bring their own newer OpenSSL, and both negotiated X25519MLKEM768 on Python 3.10.16 / OpenSSL 3.0.16. The AGY report adds niquests[rtls], curl_cffi, wreq, grpcio and psycopg[binary] as clients that do not depend on the host OpenSSL (clients). The durable fix is a runtime on OpenSSL 3.5+, such as uv python install or a python:3.13-slim-trixie, python:3.15-slim or alpine3.24 image.
FIPS and CNSA 2.0 deployments must configure SecP384r1MLKEM1024#
For National Security Systems only SecP384r1MLKEM1024 matches CNSA 2.0 parameters (ML-KEM-1024 with P-384). pyca’s FIPS mode disables X25519, so its MLKEM768_X25519 HPKE hybrid is unavailable there; MLKEM1024_P384 and SecP384r1MLKEM1024 are the CNSA-shaped options (cryptography). On Python 3.15 that means set_groups("SecP384r1MLKEM1024:…"), since it is not in OpenSSL’s default list; this was not tested in FIPS mode. BoringSSL-based grpcio lacks this group.
A commercial X25519MLKEM768 connection is useful protection, not proof of CNSA 2.0 compliance. The CNSA TLS 1.3 profile cited by NSA is an Internet-Draft that specifies standalone ML-KEM-1024 and ML-DSA-87 (draft-becker-cnsa2-tls-profile-06); the policy context is on the advisory page.
Verify the negotiated group, not the Python version or the cipher#
On 3.15, log SSLSocket.group() in a health check. On older versions, fetch https://pq.cloudflareresearch.com/cdn-cgi/trace and look for kex=X25519MLKEM768 in the server’s echo. For your own domain, the Caddy maintainers suggest curl -v --curves X25519MLKEM768 https://your.domain (caddy #8494). macOS system curl (LibreSSL 3.3.6) offers no ML-KEM at all (supply chain).
The same cipher can carry different protection. In the ASTRA report’s local handshake test, every success used TLS_AES_256_GCM_SHA384 and an RSA handshake signature, whether the group was hybrid or classical ASTRA. Neither the Python version, the cipher string, a client offer nor a successful HTTP request proves protection. The first row also shows the hybrid needs no new certificate: it still authenticates with RSA.
For a staging canary, record the final group at the terminator on a fresh verified connection, the handshake signature algorithm and the validated certificate path, separately. On older runtimes use trusted terminator telemetry, or the final ServerHello key share in an authorized staging trace; no session secrets or payloads are needed. If a middlebox chokes on the larger ClientHello, use ?X25519MLKEM768 without *. Audit scripts are on the toolkit page.
Reciperead the negotiated group on any Python version
On 3.15 use group(). On older versions, read the server-side echo from Cloudflare’s trace endpoint. This uses pq_client_context() from the client recipe.
import socket, ssl
HOST = "pq.cloudflareresearch.com"
ctx = pq_client_context()
with socket.create_connection((HOST, 443)) as s, ctx.wrap_socket(s, server_hostname=HOST) as t:
print(getattr(t, "group", lambda: "n/a (<3.15)")()) # 3.15+: 'X25519MLKEM768'
t.sendall(b"GET /cdn-cgi/trace HTTP/1.1\r\nHost: " + HOST.encode() + b"\r\nConnection: close\r\n\r\n")
body = b"".join(iter(lambda: t.recv(65536), b"")).decode()
print([l for l in body.splitlines() if l.startswith(("kex=", "tls="))]) # ['tls=TLSv1.3', 'kex=X25519MLKEM768']
Test logASTRA's local handshake test, same cipher with different protection
Fresh, non-resumed handshakes over a local socket pair with a temporary trusted CA, an RSA-3072 server certificate, hostname verification enabled, and a CPython 3.15.0/OpenSSL 3.5.9 server. No production endpoint was tested. For all three successes the cipher was TLS_AES_256_GCM_SHA384 and the server handshake signature rsa_pss_rsae_sha256.
| Tested client / policy | Server group policy | Result observed at server |
|---|---|---|
| Python 3.15.0 / OpenSSL 3.5.9, defaults | Defaults | TLS 1.3, X25519MLKEM768 |
Same client, allowed group X25519 only |
Defaults | TLS 1.3, x25519, classical only |
| Python 3.11.7 / OpenSSL 3.6.3, defaults | Defaults | TLS 1.3, X25519MLKEM768, despite no group() on that client |
| Classical-only client | X25519MLKEM768 only |
Handshake rejected: NO_SUITABLE_KEY_SHARE, as intended |
Clients inherit the interpreter’s OpenSSL unless they bundle their own TLS stack#
requests, urllib3, httpx and aiohttp set no groups and use stdlib ssl, so they offer the hybrid exactly when the interpreter links OpenSSL 3.5+. requests negotiated X25519MLKEM768 on 3.14.6/OpenSSL 3.5.7 and X25519 on 3.10.16/OpenSSL 3.0.16. The database drivers asyncpg, pymongo and redis-py, plus pip and boto3, follow the same rule.
Some clients ship their own TLS stack and offer the hybrid even on an OpenSSL 3.0 interpreter: pycurl, the pyOpenSSL path, niquests with rtls, curl_cffi and wreq, grpcio and psycopg’s binary build. aioquic runs its own TLS on PyCA primitives, so the cryptography build decides its transport. Do not extrapolate from a requests probe to HTTP/3, gRPC or database connections.
Updating certifi changes CA material, not the selected group. Audit the actual transports, custom contexts and TLS-inspecting proxies. Traffic to github.com and api.github.com stays X25519-only even from PQ-capable clients, because GitHub’s servers do not select the hybrid (supply chain).
| Client | TLS engine | Hybrid by default | How to pass a 3.15 context or groups |
|---|---|---|---|
| requests 2.34.2 / urllib3 2.8.0 | stdlib ssl |
on OpenSSL ≥3.5 | PoolManager(ssl_context=ctx); HTTPAdapter subclass |
| httpx 0.29.0 | stdlib ssl, certifi CAs |
on OpenSSL ≥3.5 | httpx.Client(verify=ctx) |
| aiohttp 3.14.5 | stdlib ssl |
on OpenSSL ≥3.5 | ssl=ctx, TCPConnector(ssl=ctx) |
| asyncpg 0.32.0, pymongo 4.20.2, redis-py 8.2.0 | stdlib ssl |
on OpenSSL ≥3.5 | Set TLSv1_3 minimum explicitly |
| pycurl 7.49.0 | libcurl 8.23.0, OpenSSL 3.6.5 | even on OpenSSL 3.0 | SSL_EC_CURVES (untested) |
pyOpenSSL 26.5.1 via inject_into_urllib3() |
cryptography wheel, OpenSSL 4.1.1 | even on OpenSSL 3.0 | No set_groups |
| niquests 3.21.3 with rtls | rustls with aws-lc-rs | any host OpenSSL | niquests[rtls] |
| curl_cffi 0.17.0, wreq 0.13.0 | BoringSSL | any host OpenSSL | |
| grpcio 1.86.0 | BoringSSL | since 1.83.0 | |
| aioquic 1.9.2 | own TLS on PyCA | capable PyCA backend | |
psycopg 3.3.9 [binary] |
libpq 18.6, OpenSSL 3.5.9 | binary wheel | sslmode=verify-full, TLS 1.3 minimum |
The bundled-stack rows for niquests, curl_cffi, wreq and psycopg come from the AGY report only AGY. pycurl and the pyOpenSSL path were tested by the Claude report on macOS arm64. websockets was not examined by any of the three reports.
Python servers negotiate the hybrid on OpenSSL 3.5, except granian#
In live tests with a self-signed P-256 certificate and a Python 3.15.0 probe client, uvicorn 0.55.0, hypercorn 0.18.0, gunicorn 27.0.1 and tornado 6.6.2 on PBS 3.14.6/OpenSSL 3.5.7 negotiated X25519MLKEM768. twisted 26.10.0 did too on a 3.10.16/OpenSSL 3.0.16 interpreter, because it terminates TLS through pyOpenSSL on the cryptography wheel’s OpenSSL 4.1.1 Claude.
granian 2.8.9 cannot negotiate the hybrid Claude, AGY. It builds rustls 0.23.46 with the ring provider, whose ALL_KX_GROUPS are X25519, P-256 and P-384; the test got x25519. rustls’s aws-lc-rs provider defaults begin with X25519MLKEM768, but no granian issue on switching providers was found (rustls ring, rustls aws-lc-rs). Front it with a PQ-capable proxy or switch servers.
No server exposes a groups flag. To require the hybrid on 3.15, use the hooks; hypercorn, twisted and daphne have none. waitress is believed to have no TLS support and to rely on a proxy (not inspected).
| Server | TLS engine | Group in tests | Hook to require the hybrid |
|---|---|---|---|
| uvicorn 0.55.0 | stdlib ssl |
X25519MLKEM768 on 3.5.7 | ssl_context_factory (≥0.47.0) |
| gunicorn 27.0.1 | stdlib ssl |
X25519MLKEM768 on 3.5.7 | ssl_context(conf, default_ssl_context_factory) (≥21.0) |
| hypercorn 0.18.0 | stdlib ssl (H1/H2); aioquic 1.9.2 (H3) |
X25519MLKEM768 on 3.5.7 | None; subclass Config |
| tornado 6.6.2 | stdlib ssl |
X25519MLKEM768 on 3.5.7 | HTTPServer(..., ssl_options=ctx) |
| twisted 26.10.0 | pyOpenSSL, OpenSSL 4.1.1 | X25519MLKEM768 on OpenSSL 3.0 | None (set_groups not exposed) |
| daphne 4.2.3 | Twisted, pyOpenSSL | inferred, not tested | None |
| granian 2.8.9 | rustls 0.23.46, ring |
x25519 only | None possible |
| waitress | None (believed) | no TLS, not inspected | Terminate at a proxy |
Backgroundwhy the AGY report prefers proxy termination
The AGY report recommends terminating inbound TLS at nginx (OpenSSL ≥3.5), Envoy (BoringSSL), Caddy (Go ≥1.24), Cloudflare or AWS ALB with a PQC policy. Its reasons: this decouples PQC agility from Python, granian and OS OpenSSL lifecycles; offloads the heavier ML-KEM/ML-DSA handshake CPU from Python workers; handles fragmented ClientHellos and 11–18 KB ML-DSA chains; and provides negotiated-group telemetry. Envoy and ALB still need configuration (proxies).
ML-DSA-signed tokens can also exceed default header limits in nginx (large_client_header_buffers 4 8k) and in uvicorn and hypercorn on h11 (16 KB); sizes and fixes are on the FastAPI page.
Every proxy hop is its own handshake with its own default#
Most FastAPI deployments terminate TLS at an edge proxy, so the edge is where hybrids must be on first (FastAPI deployment guide). Harvest-now-decrypt-later applies to every hop that crosses an untrusted network, not just the edge. The proxy-to-app leg is a separate TLS session, or plaintext inside a VPC; who owns each hop is on the FastAPI page.
Cloudflare, CloudFront, GCP load balancers (since Oct 2026), Caddy, and nginx or HAProxy on OpenSSL 3.5+ offer the hybrid to clients by default. AWS ALB needs a PQ listener policy, Envoy needs ecdh_curves (its default is X25519 and P-256), and Azure Front Door needs its per-domain key-exchange policy. Traefik follows Go’s default unless curvePreferences is set.
Origin legs differ. Cloudflare negotiates PQ automatically to origins that support it, so a Cloudflare-to-uvicorn leg is PQ if uvicorn runs on an OpenSSL 3.5+ Python. Azure Front Door’s policy and GCP’s default cover only the client-facing leg. ALB selects its backend TLS policy separately and does not validate HTTPS target certificates (ALB details).
| Edge | Hybrid toward clients | Notes |
|---|---|---|
| Cloudflare | on, also to origins | A “Post-quantum hybrid” compliance setting returns 525 if the origin lacks PQ (Cloudflare PQC to origin) |
| AWS CloudFront | on | “prefer hybrid PQ key exchange… No action needed” (AWS PQ readiness) |
| AWS ALB | PQ listener policy | “Customers must update listener configuration” (same source); the console default differs, see below |
| GCP load balancers | on since Oct 2026 | Client to LB only. The DEFERRED policy disallows it until October 2027 (GCP SSL policies) |
| Azure Front Door | per-domain policy | A per-domain “TLS key exchange policy”. Hybrids require TLS 1.3. It does not configure the Front Door-to-origin leg (Azure Front Door) |
| Caddy | on | Go crypto/tls default since Go 1.24; issue opened and closed 3 Dec (caddy #8494, Go 1.24) |
| Traefik | Go default | Go default unless curvePreferences is set (Traefik TLS options) |
| nginx | on OpenSSL ≥3.5 | ssl_ecdh_curve auto follows the linked OpenSSL (nginx docs) |
| HAProxy | on OpenSSL ≥3.5 | Depends on OpenSSL 3.5+ and the curves setting. Secondary source only |
| Envoy | configure ecdh_curves | “In non-FIPS builds, the default curves are: X25519 P-256” (envoy common.proto) |
Sources disagreeAWS ALB, Envoy and Traefik defaults
- AWS ALB. The Claude report, citing AWS’s PQ readiness page, lists ALB as opt-in. The ASTRA report finds that console-created listeners default to
ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09while CloudFormation and CLI creation default toELBSecurityPolicy-2016-08ASTRA. Either way, read each listener’s policy and its connection-logtls_keyexchangefield; the full account is on the FastAPI page. - Envoy. The AGY report lists Envoy (BoringSSL) among PQC-capable terminators to put in front of Python. The Claude report quotes Envoy’s own docs: non-FIPS builds default to X25519 and P-256, so the hybrid must be added to
ecdh_curvesClaude. - Traefik. Secondary blogs disagree on which version made PQ the default, 3.4.2 or 3.5.0. The Claude report leaves this unresolved.
ML-DSA certificates work in Python today, but public CAs do not issue them#
A self-signed ML-DSA-65 certificate (made with Homebrew OpenSSL 4.1.0, openssl req -x509 -newkey ML-DSA-65 …) was served by uvicorn 0.55.0 on Python 3.15.0 (PBS, OpenSSL 3.5.9). A 3.15.0 client with cafile= reported TLSv1.3 group=X25519MLKEM768 server_sigalg=mldsa65. Python 3.14.6 (OpenSSL 3.5.7) connected but has no sigalg accessor, and 3.10.16 (OpenSSL 3.0.16) failed with SSLEOFError Claude.
The AGY report confirmed that ctx.load_cert_chain(), create_default_context(), the TLS 1.3 handshake and getpeercert() work with an ML-DSA-65 CA and leaf (about 5.5 KB DER each) on OpenSSL ≥3.5. Full ML-DSA chains of about 11–18 KB DER exceed the TCP initial window (IW10, about 14.6 KB) and add a round trip; they do not hit asyncio.sslproto’s 256 KB internal buffer AGY. What each algorithm adds per handshake and per request is in the next section.
Moving WebPKI leaves from P-256 to P-384 or RSA-3072 is transparent to every OpenSSL-based Python client. The same server with a P-384 certificate gave server_sigalg=ecdsa_secp384r1_sha384 with X25519MLKEM768. The work is in the ACME client and key type (certbot, infra), not in Python’s ssl. Public and private certificate paths are compared on the FastAPI page.
There is no public PQ authentication route yet. Valsorda notes “ML-DSA certificate support is far less available than ML-KEM key exchange” (Valsorda), and Cloudflare supports ML-DSA only on the Cloudflare-to-origin connection (Cloudflare PQC). The realistic WebPKI route is Merkle Tree Certificates: Cloudflare in Q1 2027, Let’s Encrypt in 2027 and Chrome’s quantum-resistant root store around Q3 2027.
certifi has no PQ roots, and truststore defers to the OS#
certifi 2026.11.20 has no PQ roots, and 23 of its 113 roots are RSA-2048 or P-256 (certifi cacert.pem). Valsorda’s “no vulnerable trust anchors” goal would require a certifi or OS-store change. No such change has been announced, so Python users can only pre-empt it with a custom CA bundle. The AGY report advises keeping certifi updated, or using truststore or OS stores, to track emergency root distrusts and future MTC or PQ anchors.
With truststore on macOS and Windows, chain validation is done by the OS verifier, and whether those verifiers accept ML-DSA chains is unknown (truststore). truststore 0.10.5’s SSLContext proxies a fixed method list with no __getattr__, so 3.15’s set_groups(), get_groups() and set_*_sigalgs() raise AttributeError (truststore _api.py) AGY. The workarounds are OPENSSL_CONF or the private ctx._ctx.set_groups(...).
Tablecertifi 2026.11.20 roots by key type
| Key type | Roots | Share |
|---|---|---|
| RSA-4096 | 54 | 47.8% |
| RSA-2048 | 20 | 17.7% |
| ECDSA P-384 | 35 | 31.0% |
| ECDSA P-256 | 3 | 2.7% |
| ECDSA P-521 | 1 | 0.9% |
| ML-DSA / PQC | 0 | 0.0% |
The Claude report counts the same file as 74 RSA (20 of them RSA-2048) and 39 EC (3 P-256, 35 P-384, 1 P-521). The three P-256 roots, per the AGY report: Amazon Root CA 3 (expires 2040), GlobalSign ECC Root CA - R4 (expires 2038) and e-Szigno Root CA 2017 (expires 2042).
Handshake bytes amortize over a reused connection; ML-DSA token bytes recur on every request#
The ASTRA report puts numbers on the three places post-quantum algorithms add bytes ASTRA. Handshake costs are paid once per connection, so pooling and HTTP/2 or HTTP/3 connection reuse spread them out. A signed token travels with every request, so its cost scales with request rate.
| What grows | Extra bytes | Paid on | What reduces it |
|---|---|---|---|
| Key shares: X25519MLKEM768 instead of X25519 | 2,272 B (2.2 KiB) | Every full or resumed handshake | Reusing the connection |
| Two ML-DSA-65 certificates plus CertificateVerify, instead of P-256 | 13,485 B (13.2 KiB) | Every full handshake | Session resumption or reusing the connection |
| An ML-DSA-65 JWT instead of ES256 or EdDSA | 4,326 B (4.2 KiB) | Every request | Nothing in the transport |
At 10,000 requests per second, the token difference alone is about 3.7 TB a day of extra uncompressed header data ASTRA. Over QUIC, a server may send only three times what it has received before validating the client’s address, so a large ML-DSA chain costs HTTP/3 an extra round trip ASTRA. Token sizes, cookie limits and header buffers are on the FastAPI page.
Reuse connections: it is the mitigation a Python service controls. Share one requests.Session, httpx.Client or aiohttp.ClientSession per process instead of creating a client per call, and keep upstream keep-alive on at the proxy. A client created per call pays the full handshake every time.
Editorial note. Checked for this guide; not from the three reports. urllib3 2.8.0, httpcore 1.0.9 (under httpx) and aiohttp 3.14.5 never pass a saved TLS session back to
wrap_socket(), so they do not resume sessions: every new connection is a full handshake. HTTP/2 does not shrink the token either. Python’s h2 4.4.1 sendsauthorizationas a never-indexed HPACK field, and a 4.8 KB token is larger than HPACK’s default 4,096-byte table (RFC 7541 §4.4).
Evidencehow the byte counts add up
- Key shares. X25519MLKEM768 sends 1,216 B from the client and 1,120 B from the server, against 32 B each for X25519 (key-share sizes). The difference is 1,184 + 1,088 = 2,272 B.
- Certificates. An ML-DSA-65 public key is 1,952 B and a signature 3,309 B (sizes). A leaf and an intermediate each carry one key and one signature (10,522 B), and CertificateVerify adds one more signature, for 13,831 B. The P-256 equivalent is about 274 B for the two certificates (65 B keys, signatures of about 72 B in DER) and 346 B with CertificateVerify.
- Real chains are larger. Names, extensions, SCTs and DER framing come on top; the AGY report puts full ML-DSA chains at 11–18 KB DER, above the TCP initial window of about 14.6 KB (IW10) (certificates).
- Tokens. An ML-DSA-65 signature is 4,412 base64url characters against 86 for ES256 or EdDSA, so 4,326 B more per request; against RS256 (342 characters) it is 4,070 B more. 4,326 B × 10,000 requests × 86,400 s is 3.74 × 10¹² B a day: 3.7 TB, or 3.4 TiB.
- QUIC. Before address validation a server must not send more than three times the bytes it has received (RFC 9000 §8.1). A client’s first Initial is at least 1,200 B, so the server’s first flight is capped at about 3,600 B, well under an ML-DSA chain.
Editorial note. Checked for this guide; not from the three reports. The ASTRA report compares about 13 KiB for an ML-DSA-65 two-certificate chain with about 274 B for P-256; the first figure includes CertificateVerify and the second does not. Session resumption skips Certificate and CertificateVerify, but in the
psk_dhe_kemode, which OpenSSL requires unlessSSL_OP_ALLOW_NO_DHE_KEXis set, it still sends fresh key shares (RFC 8446 §4.2.9, OpenSSL options). The 2.2 KiB is paid again on every resumed handshake.
CPython and the PSF had not reacted to the advisory as of 3 Dec 2026#
No CPython, PSF, urllib3, httpx, uvicorn, hypercorn, gunicorn, aiohttp, requests, certifi, truststore, granian or Astral issue, PR or statement reacts to the advisory (discuss.python.org search). Activity since 1 Dec is routine: OpenSSL 3.5.10 bumps in CPython (gh-162936) and python-build-standalone (20261201).
The PSF Security Roadmap predates the advisory by one day (30 Nov, Seth Larson) (PSF Security Roadmap). It calls for a PQC PEP in the Python 3.16 feature window (May 2027), an adoption guide, PQ TLS on all PSF-hosted services including PyPI and python.org, an internal audit and a later deprecation schedule for quantum-vulnerable key exchange. Live probes show PQ TLS already works for pypi.org and python.org.
The roadmap is not evidence that every PyPI, CDN or mirror connection now uses hybrid TLS (supply chain). No advisory-specific FastAPI or PyCA patch, and no completed PSF-wide transition, was identified in the release material examined.
QuotesPSF Security Roadmap 2027 (30 Nov 2026)
- “Python users need access to post-quantum secure algorithms in the standard library, and a migration path to adopt those algorithms.”
- The PQC PEP targets “the Python 3.16 feature window (May 2027)”. Its draft “is already being written by Emma Smith, Bénédikt Tran, and Seth Larson”.
- “Post-quantum cryptographic algorithms (PQC) for TLS will be added to all services hosted by the PSF”.
Open questions for Python TLS#
- Whether
OPENSSL_CONFreaches the OpenSSL statically linked in cryptography and pyOpenSSL wheels: not determined. It decides whether process-wide enforcement covers twisted and the pyOpenSSL path. - Whether python-build-standalone follows RHEL crypto-policies, and whether
DEFAULT:PQreaches uv-managed Pythons: PBS reads/etc/ssl, not/etc/pki/tls(effect unverified). The RHEL 9.7 and 10.1 claims come from secondary summaries. - Whether macOS Security.framework and Windows CNG validate ML-DSA chains: unknown. This affects truststore and pip on those platforms.
- python.org Windows builds: not tested live; inferred from the bundled OpenSSL 3.5.9.
- Backports of
set_groups()andgroup()to 3.13 and 3.14: none filed. Watch gh-154517, the PSF PQC PEP, a granian aws-lc-rs build and truststore proxy support.
The cross-cutting list is on open questions, and links to watch are on trackers.
Sources cited on this page 75
- OpenSSL 3.5 github.com
- openssl-3.5 t1_lib.c github.com
- Cloudflare’s PQ test endpoint pq.cloudflareresearch.com
- RFC 10024 rfc-editor.org
- IANA registry iana.org
- openssl-4.1.1 t1_lib.c github.com
- OpenSSL 4.1.1 github.com
- OpenSSL releases github.com
- cpython PR #162986 github.com
- rfc-editor.org rfc-editor.org
- SSL_CTX_set1_curves.pod github.com
- ALAS-2026-1522 alas.aws.amazon.com
- build-installer.py github.com
- embeddable zip python.org
- cpython#158010 github.com
- gh-162936 github.com
- commit 8d1db1c32e github.com
- PBS 20261201 github.com
- PBS #1346 github.com
- downloads.json github.com
- formulae.brew.sh formulae.brew.sh
- conda-forge pinning github.com
- anaconda.org/anaconda/openssl anaconda.org
- docker-library versions.json github.com
- pkgs.alpinelinux.org pkgs.alpinelinux.org
- Debian madison qa.debian.org
- packages.ubuntu.com packages.ubuntu.com
- Red Hat blog redhat.com
- RHEL 10.1 notes docs.redhat.com
- Oracle Linux 10.1 docs.oracle.com
- AL2023: Enable PQC docs.aws.amazon.com
- uv #23494 github.com
- 3.15 SSL reference docs.python.org
- OpenSSL group-list semantics docs.openssl.org
- pyOpenSSL 26.5.1 pypi.org
- uses PyCA’s binding github.com
- Modules/_ssl.c github.com
- ssl.rst github.com
- uvicorn config.py github.com
- What’s New 3.15 docs.python.org
- ssl docs docs.python.org
- gh-136306 github.com
- gh-137197 github.com
- gh-138252 github.com
- build guards github.com
- gh-154517 github.com
- uvicorn #2920 github.com
- urllib3 ssl_.py github.com
- httpx _config.py github.com
- gunicorn config.py github.com
- hypercorn config.py github.com
- draft-becker-cnsa2-tls-profile-06 ietf.org
- caddy #8494 github.com
- rustls ring github.com
- rustls aws-lc-rs github.com
- FastAPI deployment guide github.com
- Cloudflare PQC to origin developers.cloudflare.com
- AWS PQ readiness aws.amazon.com
- GCP SSL policies docs.cloud.google.com
- Azure Front Door learn.microsoft.com
- Go 1.24 go.dev
- Traefik TLS options github.com
- nginx docs nginx.org
- envoy common.proto github.com
- Valsorda words.filippo.io
- Cloudflare PQC developers.cloudflare.com
- certifi cacert.pem github.com
- truststore github.com
- truststore _api.py github.com
- RFC 7541 §4.4 rfc-editor.org
- RFC 9000 §8.1 rfc-editor.org
- RFC 8446 §4.2.9 rfc-editor.org
- OpenSSL options docs.openssl.org
- discuss.python.org search discuss.python.org
- PSF Security Roadmap pyfound.blogspot.com