PQ Python

pyOpenSSL

pyOpenSSL runs TLS on the cryptography wheel’s bundled OpenSSL 4.1.1, so it offers X25519MLKEM768 by default even on an interpreter linked to OpenSSL 3.0, but it has no API to choose groups.

PyPI
pyOpenSSL
Version cited
26.5.12 Dec 2026
Downloads
180M/mo

Key exchange and encryption

PQ by default

X25519MLKEM768 default via wheel OpenSSL

Signatures and identity

Unknown

ML-DSA certificate use not reported

What to do

Keep cryptography wheels current (pyOpenSSL needs >=49,<52). Remove set_tmp_ecdh calls that pin a classical curve. Use the stdlib ssl on Python 3.15 if you need to set or require groups.

Since 1 Dec 2026 26.5.0 and 26.5.1 (2 Dec 2026) are routine releases that cap cryptography <52; no advisory mention as of 3 Dec 2026.

Details

PQ TLS by default no set_groups API

pyOpenSSL 26.5.1 (2 Dec 2026; 180,474,890 downloads per 30 days) requires cryptography>=49.0.0,<52 (PyPI, PyPI JSON) and uses pyca’s binding. It therefore does TLS with the OpenSSL statically linked into the cryptography wheel, 4.1.1 in cryptography 51.0.0, not with the interpreter’s OpenSSL. X25519MLKEM768 is on by default. 26.5.0 and 26.5.1 are routine releases that cap cryptography below 52 (pyOpenSSL CHANGELOG).

Test results#

  • On Python 3.10.16 / OpenSSL 3.0.16, urllib3.contrib.pyopenssl.inject_into_urllib3() with a current cryptography wheel negotiated X25519MLKEM768. The Claude report names this, with pycurl, as the quickest outbound PQ path for interpreters stuck on OpenSSL 3.0 Claude.
  • twisted 26.10.0 on Python 3.10.16 / OpenSSL 3.0.16, with pyOpenSSL 26.5.1 / cryptography 51.0.0 / OpenSSL 4.1.1, negotiated X25519MLKEM768 Claude.
  • In one isolated CPython 3.13.5 process, ssl reported OpenSSL 3.6.3 while cryptography 51.0.0 and pyOpenSSL 26.5.1 both reported 4.1.1. openssl version in a shell can describe a third build ASTRA.
  • daphne (Twisted, then pyOpenSSL, then cryptography’s OpenSSL 4.1.1) gets PQ by default according to the AGY report; the Claude report marks daphne as inferred, not tested.

Limits#

  • No Context.set_groups() (AGY) and no set_groups API (Claude). Twisted does not expose one either. It does expose Connection.get_group_name() for observing the negotiated group.
  • set_tmp_ecdh sets a single curve. Any explicit classical-only curve list disables X25519MLKEM768, which is why the Claude report’s kill-switch grep includes set_tmp_ecdh.
  • Whether OPENSSL_CONF reaches the OpenSSL statically linked inside the cryptography and pyOpenSSL wheels was not determined (unknowns).
  • webauthn 3.0.1 requires pyOpenSSL>=26.3.0.

Server and client configuration is on the TLS page.

Sources cited on this page 4
  1. PyPI pypi.org
  2. PyPI JSON pypi.org
  3. uses pyca’s binding github.com
  4. pyOpenSSL CHANGELOG github.com

All sources across the guide