Post-quantum TLS readiness
Enable hybrid PQC on nginx
With OpenSSL 3.5 or later, nginx already prefers X25519MLKEM768 unless ssl_ecdh_curve replaces the default list.
Minimum versions
nginx built against OpenSSL 3.5 or later. Official OpenSSL 3.5 put X25519MLKEM768 first in the default TLS 1.3 group list. Distros that already ship this include Debian 13 and Ubuntu 26.04 (as of the NGINX Community Blog update on 4 Dec 2026).
Configuration
nginx.conf (http or server)
# TLS 1.3 is required for hybrid groups. Keep TLS 1.2 if you still have older clients.
ssl_protocols TLSv1.2 TLSv1.3;
# Only needed if you already set ssl_ecdh_curve, or if a system crypto policy
# dropped the hybrid group (see RHEL / Amazon Linux notes below).
# Otherwise leave ssl_ecdh_curve unset so nginx uses the OpenSSL 3.5 default,
# which starts with X25519MLKEM768 and still falls back to classical groups.
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;
How to verify
openssl s_client -tls1_3 -groups X25519MLKEM768 -connect HOST:443 </dev/null 2>&1 | grep -E "Negotiated TLS1.3 group|Server Temp Key|handshake failure"
# Expect: Negotiated TLS1.3 group: X25519MLKEM768
# Needs OpenSSL 3.5+ on the machine running the command (otherwise a failure is a false negative).
# Or: pqcscan HOST
Notes
- If ssl_ecdh_curve is unset, nginx uses OpenSSL’s built-in list (`ssl_ecdh_curve auto`). On OpenSSL 3.5 that list already starts with X25519MLKEM768, so no config change is required.
- A line such as `ssl_ecdh_curve X25519:prime256v1:secp384r1;` replaces the default and removes the hybrid group. Either remove it, or put X25519MLKEM768 first.
- Confirm the linked OpenSSL with `nginx -V 2>&1 | grep -i openssl` and test the config with `nginx -t` before reload.
- RHEL 9 / Alma / Rocky 9 ship OpenSSL 3.5 but their DEFAULT crypto policy leaves the hybrid group out. The NGINX blog documents `sudo update-crypto-policies --set DEFAULT:PQ` and a restart. On Amazon Linux 2023, set `ssl_ecdh_curve` explicitly as above.
- Do not change certificates. This only affects key exchange.
Fix with your agent
Paste this into Cursor, Claude Code or Codex in the repo that terminates TLS. Review the PR, and test in staging first. The packaged skill is not published yet.
You are fixing TLS key exchange for post-quantum readiness (hybrid X25519MLKEM768).
1. If I have a pqc-report.json, read it. Otherwise run:
openssl s_client -tls1_3 -groups X25519MLKEM768 -connect HOST:443 </dev/null
(needs OpenSSL 3.5+; a handshake failure means the server does not offer hybrid).
2. Find TLS config in this repo: nginx (ssl_ecdh_curve), Caddy (tls { curves }), HAProxy (ssl-default-bind-curves),
Node (ecdhCurve), Go (tls.Config.CurvePreferences), Dockerfile base images.
3. Enable X25519MLKEM768 FIRST with classic fallback (X25519, secp256r1). Never remove the fallback.
4. Flag anything pinned to OpenSSL < 3.5, Go < 1.24 or an old Node, and propose a version bump. Do not bump silently.
5. If TLS terminates at Cloudflare or an AWS ALB/CloudFront, tell me to change that service's TLS policy instead of editing origin config.
6. Grep for RSA/ECDH/ECDSA usage in code and add `// TODO(crypto-agility)` comments only. Do not change certificates or key types.
7. Open a PR that explains each change, how to verify it, and how to roll back.
Sources
- NGINX Community Blog: PQC support in NGINX (updated 4 Dec 2026)
- NGINX docs: Enable post-quantum cryptography (ssl_ecdh_curve example)
- nginx.org: ssl_ecdh_curve in ngx_http_ssl_module
- OpenSSL 3.5 SSL_CONF_cmd: default TLS group list starts with X25519MLKEM768
Reviewed 4 Dec 2026 against the official pages linked above. If a vendor page has since changed, follow the vendor page. Other stacks: Caddy · HAProxy · Node.js · Go · OpenSSL · Cloudflare · AWS Application Load Balancer · Java (JDK)