To enable post-quantum TLS on nginx you need an nginx binary linked against OpenSSL 3.5 or newer and a TLS 1.3 listener; then either leave ssl_ecdh_curve at its default auto (OpenSSL 3.5 already prefers the hybrid group) or set it explicitly to X25519MLKEM768:X25519:prime256v1:secp384r1. Verify with openssl s_client -groups X25519MLKEM768, which should report Negotiated TLS1.3 group: X25519MLKEM768. The hard part is not the config line. It is finding out which OpenSSL your nginx actually uses, and knowing what this change does and does not protect.

What hybrid ML-KEM protects against, and what it doesn't

X25519MLKEM768 is a hybrid key exchange. The client sends both a classical X25519 share and an ML-KEM-768 encapsulation key; the session secret is derived from both, so an attacker has to break both to recover it. ML-KEM is the lattice-based KEM standardized by NIST as FIPS 203 on August 13, 2024, and the hybrid TLS groups are now specified in RFC 10024 (August 2026), which defines X25519MLKEM768 (codepoint 0x11EC), SecP256r1MLKEM768 and SecP384r1MLKEM1024.

What it protects against: harvest now, decrypt later. Someone recording your TLS traffic today cannot decrypt it with a future quantum computer, because the session keys were never derived solely from elliptic-curve math. If you serve data that must stay confidential for years (health records, financial data, credentials, internal APIs carrying personal data), this is the threat that justifies doing the work now rather than later.

What it does not protect against:

  • Server impersonation. Your certificate and the handshake signature are still RSA or ECDSA. A quantum attacker who can break those could impersonate your server in a live connection, but cannot retroactively decrypt recorded sessions. Authentication only matters at connection time, which is why key exchange was migrated first.
  • TLS 1.2 clients. The hybrid groups are TLS 1.3 only. Old clients keep negotiating classical ECDHE.
  • Anything outside the TLS session. Data at rest, backups, and other protocols (SSH, VPNs, message queues) need their own migration.

On post-quantum certificates: OpenSSL 3.5 can generate and use ML-DSA keys, but browsers don't trust ML-DSA certificates from public CAs. Per Cloudflare's support tracker, Chrome has said it won't add standard X.509 post-quantum certificates to its root store and is instead working on Merkle Tree Certificates in the IETF. For a public website in late 2026, PQ authentication is not something you can deploy; PQ key exchange is. For the broader landscape of PQC libraries, scanners and inventory tools, see our post-quantum cryptography tools roundup. This article is only about turning it on at the TLS edge.

Who already speaks X25519MLKEM768

Clients have mostly moved already, which is why server-side support pays off immediately:

Client Default since Source
Chrome / Edge 131 Google Security Blog, Cloudflare tracker
Firefox desktop 132 (HTTP/3 from 135) Mozilla bug 1919097, Cloudflare tracker
Firefox Android 145 Firefox 145 Android release notes
Safari, iOS/macOS system TLS iOS 26, macOS Tahoe 26 Apple support article
Go crypto/tls Go 1.24 Go 1.24 release notes
OpenSSL 3.5.0 OpenSSL 3.5 release notes

So the bottleneck is almost always the server, and on nginx, the server is whatever OpenSSL it was linked against.

Step 1: find the OpenSSL your nginx actually uses

openssl version tells you about the command-line tool. nginx may be linked against something else entirely. Ask nginx:

nginx -V 2>&1 | grep -i openssl

The nginx team's PQC post shows what this looks like on two Debian releases: Debian 12 reports built with OpenSSL 3.0.16 ... (running with OpenSSL 3.0.17 ...) and Debian 13 reports built with OpenSSL 3.5.1. If you see 3.0.x, 3.1.x, 3.2.x, 3.3.x or 3.4.x, you cannot negotiate ML-KEM with the default providers.

What the main distributions ship, checked against the Debian and Ubuntu package archives in November 2026:

Distribution OpenSSL in the archive PQ with distro nginx?
Debian 12 (bookworm) 3.0.x No
Debian 13 (trixie) 3.5.x Yes
Ubuntu 22.04 LTS 3.0.2 (with security patches) No
Ubuntu 24.04 LTS 3.0.13 (with security patches) No
Ubuntu 26.04 LTS 3.5.5 Yes

The nginx blog also lists Alpine 3.22, RHEL-family 10.1 and SLES 16 as shipping OpenSSL 3.5.x. I haven't independently checked those package versions, so confirm with nginx -V on your images.

If you are stuck on an older base, your options in order of preference:

  1. Upgrade the OS or container base image (Debian 13, Ubuntu 26.04). Least custom work, normal security updates.
  2. Build nginx against OpenSSL 3.5 source using nginx's --with-openssl= configure option. This works but makes you responsible for tracking OpenSSL security releases yourself. OpenSSL 3.5 is the current LTS, supported until April 8, 2030.
  3. Load the Open Quantum Safe provider into OpenSSL 3.0, as the nginx blog describes. Fine for experiments; another moving part in production.
  4. Terminate TLS somewhere that already supports it, such as a CDN or a load balancer, and treat the origin hop separately.

Kubernetes users should check the controller image, not the node OS. The nginx blog notes the F5 NGINX Ingress Controller default image is Debian 12-based while its Alpine image is PQ-capable. If you are already moving off ingress-nginx, that migration to Gateway API is a good moment to pick a data plane with an OpenSSL 3.5 or Go 1.24+ TLS stack.

Step 2: configure nginx

The ssl_ecdh_curve directive defaults to auto, which tells nginx to use the list built into OpenSSL. In OpenSSL 3.5 that built-in list is:

?*X25519MLKEM768 / ?*X25519:?secp256r1 / ?X448:?secp384r1:?secp521r1 / ?ffdhe2048:?ffdhe3072

That comes from TLS_DEFAULT_GROUP_LIST in the 3.5 source. The / separates tuples of comparable security, * marks groups a client sends key shares for, and ? means "ignore if unavailable". Because the hybrid group is alone in the first, most-preferred tuple, an OpenSSL 3.5 server will choose it whenever the client offers it. So if nginx is on OpenSSL 3.5 and nobody has set ssl_ecdh_curve, you likely already have post-quantum key exchange. (OpenSSL's development branch adds SecP256r1MLKEM768 and curveSM2MLKEM768 to that first tuple, so expect the default to grow.)

Many configs do set it, usually to something copied from an old hardening guide like secp384r1 or X25519:prime256v1:secp384r1. That silently disables PQ. Replace it with an explicit list:

server {
    listen 443 ssl;
    http2 on;
    server_name example.com;

    ssl_certificate     /etc/ssl/example.com/fullchain.pem;
    ssl_certificate_key /etc/ssl/example.com/privkey.pem;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;
}

Three notes on that list:

  • Keep the classical groups. TLS 1.2 clients and TLS 1.3 clients without ML-KEM need something to negotiate. The nginx docs also point out that with OpenSSL 1.0.2+ this directive sets the server's supported curves, so ECDSA certificates need their curve (prime256v1 for a P-256 key, secp384r1 for P-384) in the list.
  • Put the hybrid group first. In this colon-only form there are no tuples, and OpenSSL prefers a group the client already sent a key share for (client preference wins unless server preference is enabled). Browsers list X25519MLKEM768 first and send a key share for it, so it gets picked. Ordering it first also keeps your intent obvious to the next person who reads the config.
  • The ? prefix needs OpenSSL 3.3 or later. The 3.0 and 3.2 man pages don't document it. On an older OpenSSL, X25519MLKEM768 in the list is a hard error, and the nginx blog shows the result: nginx: [emerg] SSL_CTX_set1_curves_list("X25519MLKEM768:X25519:prime256v1") failed. This is why you check nginx -V first, and why config management that targets mixed fleets should template this line per OpenSSL version.

Test and reload:

sudo nginx -t && sudo systemctl reload nginx

The stream module has the same ssl_ecdh_curve directive if you terminate TLS for non-HTTP protocols.

Log the negotiated group

To measure how much traffic is actually post-quantum, log $ssl_curve:

log_format tls_kex '$remote_addr [$time_local] "$request" $status '
                   '$ssl_protocol $ssl_cipher $ssl_curve';
access_log /var/log/nginx/tls_kex.log tls_kex;

$ssl_curve needs OpenSSL 3.0+, and nginx 1.27.5 fixed both $ssl_curve and $ssl_curves for "pluggable curves in OpenSSL", which covers provider-supplied groups such as the ML-KEM hybrids. Use 1.27.5 or newer (any 1.28+ stable) before trusting these numbers.

Step 3: verify from the outside

Use an OpenSSL 3.5+ client and offer only the hybrid group, so the handshake either uses it or fails:

echo | openssl s_client -connect example.com:443 -servername example.com \
  -tls1_3 -groups X25519MLKEM768 -brief

Against a server that supports it (output captured with OpenSSL 4.1.0 against cloudflare.com):

CONNECTION ESTABLISHED
Protocol version: TLSv1.3
Ciphersuite: TLS_AES_256_GCM_SHA384
Peer certificate: CN=cloudflare.com
Hash used: SHA256
Signature type: ecdsa_secp256r1_sha256
Verification: OK
Negotiated TLS1.3 group: X25519MLKEM768
DONE

Note the Signature type line: the certificate is still classical ECDSA, as discussed above. Against a server that doesn't support the group, the same command fails with tls alert handshake failure (alert 40), because the client offered nothing else. Drop the -groups flag and the client falls back; a non-PQ server then shows Peer Temp Key: X25519, 253 bits in the full output instead of a negotiated hybrid group. Run it from a machine whose openssl version is 3.5 or later; an older client doesn't know the group name, so the test fails locally and tells you nothing about the server.

In browsers, Chrome's DevTools security panel shows the key exchange in the connection details for the page; on a PQ-enabled server it lists X25519MLKEM768 alongside the protocol and cipher. On macOS Tahoe 26, Apple documents nscurl --tls-diagnostics https://example.com, which reports Negotiated TLS key exchange group (name): X25519MLKEM768 on success.

Put the s_client check into CI or your synthetic monitoring. A config management change that "harmonizes" ssl_ecdh_curve across servers can quietly undo all of this, and nothing else will tell you.

Middleboxes and the bigger ClientHello

Per RFC 10024, an X25519MLKEM768 client key share is 1,216 bytes (1,184 for ML-KEM plus 32 for X25519) and the server's is 1,120 bytes. A ClientHello carrying it no longer fits in a single typical TCP segment. Well-written TLS stacks don't care. Some middleboxes and old servers assume the whole ClientHello arrives in one packet and break or time out; OpenSSL's own docs warn that the default keyshare "can lead to failures or timeouts" behind such firewalls, and Apple, Go and others point to tldr.fail for the details.

For your server, the risk is whatever sits in front of nginx: an old L4/L7 load balancer, a WAF, an IDS doing TLS inspection. Test through the full production path, not just against the nginx host directly. Browsers have been sending this ClientHello since late 2024, so if something in your path broke on it, you may already have unexplained handshake failures in your logs.

For outbound connections, remember that any application linked against OpenSSL 3.5 now sends the larger ClientHello by default. If an internal client starts timing out against a legacy server after a base image upgrade, this is a likely cause. OpenSSL's documented workaround is to prepend ?X25519MLKEM768: (without *) to DEFAULT in the client's group list, which keeps the group supported but stops it from being sent as a predicted key share. The hybrid is then only used after a HelloRetryRequest from servers that specifically ask for it. In Go, GODEBUG=tlsmlkem=0 reverts the default. Treat both as temporary while the broken peer gets fixed.

Other servers: Caddy, HAProxy and Go

Caddy. Since Caddy 2.10.0, x25519mlkem768 is supported by default. Caddy's tls directive has a curves option, and its docs recommend not changing the defaults. Follow that advice: setting curves to a classical-only list turns PQ off.

HAProxy. HAProxy passes the curves bind option (and the global ssl-default-bind-curves) to OpenSSL as a colon-delimited list, so the behaviour depends entirely on the OpenSSL it was built with. With OpenSSL 3.5 and no curves set, you get OpenSSL's defaults, hybrid included. If you set it, include the hybrid explicitly:

global
    ssl-default-bind-curves X25519MLKEM768:X25519:P-256:P-384

Check the library with haproxy -vv, which prints both the OpenSSL version HAProxy was built with and the one it is running on.

Go. Since Go 1.24, crypto/tls enables X25519MLKEM768 by default when Config.CurvePreferences is nil. If you set CurvePreferences, Go now ignores its order and uses it only to decide which groups are enabled, so a list that lacks tls.X25519MLKEM768 disables PQ. The fix is usually to delete the field. This also covers Go-based proxies such as Traefik, which build on crypto/tls.

A short rollout checklist

  1. Inventory TLS endpoints and record the TLS library and version behind each. This is also the first step of any zero trust architecture effort, since you can't reason about encryption you haven't mapped.
  2. Fix the base: OpenSSL 3.5+ for nginx and HAProxy, Go 1.24+ for Go services, Caddy 2.10+.
  3. Remove or update hardcoded curve lists (ssl_ecdh_curve, curves, CurvePreferences).
  4. Verify with openssl s_client -groups X25519MLKEM768 through the full production path.
  5. Log $ssl_curve and watch the share of hybrid handshakes.
  6. Add a synthetic check so a future config change can't silently revert it.

Frequently Asked Questions

Does enabling X25519MLKEM768 slow down TLS handshakes?

It adds roughly 2.3 KB to the handshake (the 1,216-byte client share and 1,120-byte server share from RFC 10024) plus ML-KEM computation, which is fast relative to the signature operations already in the handshake. Every major browser enabled it by default, which tells you the vendors judged the cost acceptable at web scale. Measure on your own traffic if you are latency-sensitive, rather than relying on someone else's benchmark.

Do I need a post-quantum certificate as well?

Not today, and for public websites you can't get one browsers will trust. Hybrid key exchange defends against recorded traffic being decrypted later; certificate signatures only need to resist attack at the moment of connection. Watch the IETF work on Merkle Tree Certificates and your CA's ML-DSA plans, but don't block the key exchange change on it.

Will old clients break if I add X25519MLKEM768 to ssl_ecdh_curve?

No, as long as you keep classical groups in the list. Clients that don't offer the hybrid group negotiate X25519 or P-256 as before, and TLS 1.2 clients never see it. The breakage risk is on the network path (middleboxes mishandling large ClientHellos), and browsers have been sending those since 2024.

Why does nginx fail to start with X25519MLKEM768 in the config?

Your nginx is linked against an OpenSSL older than 3.5, which doesn't know the group name and rejects the whole list. Check nginx -V; if it shows OpenSSL 3.0.x, upgrade the OS or image, rebuild nginx against 3.5, or remove the group from that host's config until you can.

Is ML-KEM the same as Kyber?

ML-KEM is the standardized form of CRYSTALS-Kyber, published as FIPS 203. The two are not wire-compatible: browsers first shipped X25519Kyber768Draft00, and Chrome 131 and Go 1.24 replaced it with the standardized X25519MLKEM768. Go 1.24 removed the draft Kyber group entirely, so configure the ML-KEM name.

Conclusion

On a modern stack, post-quantum key exchange is a default you mostly need to stop blocking. Confirm nginx is linked against OpenSSL 3.5+, delete or fix any hardcoded ssl_ecdh_curve, verify with openssl s_client -groups X25519MLKEM768, and test through every middlebox in the path. That closes the harvest-now-decrypt-later gap for TLS 1.3 traffic. Post-quantum authentication is a separate, later project that depends on browsers and CAs, not on your config.