Enable post-quantum TLS (X25519MLKEM768) on nginx and Caddy
How to enable hybrid post-quantum TLS with X25519MLKEM768 on nginx, Caddy, Go and cloud load balancers, with exact configuration and commands to verify it.
Published 5 min readBy Imad Ez
On this page
To enable post-quantum TLS, make your server negotiate the hybrid key exchange group X25519MLKEM768 on TLS 1.3. In practice that means one of three things: run a TLS library that offers it by default (OpenSSL 3.5 or later, Go 1.24 or later), list it explicitly in your server's groups setting, or pick the post-quantum policy on your cloud load balancer. Then verify with a client that offers only that group. It protects against harvest-now-decrypt-later for the client-to-server leg, and takes minutes on most stacks.
Why this group
X25519MLKEM768 combines classical X25519 with ML-KEM-768, so the session key stays safe if either holds. It is registered with codepoint 0x11EC in RFC 10024 (Proposed Standard, August 2026). The cost is about 1.2 KB more in the handshake. See why hybrids.
Where it is the default, according to Cloudflare's support list: Chrome 131 and later, Firefox 132 and later on desktop, Safari 26 and later, Go 1.24 and later, and OpenSSL 3.5.0 and later. That is the client side. A server only uses it if it is built to support and prefer it.
Step 0: see what you have today
Using OpenSSL 3.5 or later on your machine (tested with OpenSSL 4.0.3, which negotiated the hybrid with cloudflare.com and google.com):
openssl version
openssl s_client -connect example.com:443 -tls1_3 -groups X25519MLKEM768 </dev/null 2>/dev/null \
| grep -iE "negotiated tls1.3 group|^New"
If the server supports it you see Negotiated TLS1.3 group: X25519MLKEM768. If not, the handshake fails or falls back; on a server limited to X25519 we saw Peer Temp Key: X25519, 253 bits in the output of a run that offered -groups X25519. macOS ships LibreSSL as /usr/bin/openssl, which cannot offer ML-KEM; install a current OpenSSL.

You can also use the post-quantum TLS check, which connects from our server to a public hostname.
nginx
nginx uses whichever OpenSSL it is linked against. Check first:
nginx -V 2>&1 | grep -o "built with OpenSSL [0-9.]*"
If it reports 3.5 or later (untested on a live server; configuration per the nginx docs, which describe ssl_ecdh_curve as accepting a colon-separated list):
server {
listen 443 ssl;
server_name example.com;
ssl_protocols TLSv1.3 TLSv1.2;
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1;
# ssl_certificate and ssl_certificate_key as before
}
The classical groups stay in the list so older clients still connect. Two notes. First, if you leave ssl_ecdh_curve at its default auto, nginx uses OpenSSL's built-in list, and OpenSSL 3.5 and later prefers the hybrid groups there; the explicit line makes the intent visible and survives a library change. Second, nginx's documentation says that for ECDSA certificates to work the curves used in the certificates must be in the list, which is why prime256v1 stays.
Reload and test:
sudo nginx -t && sudo systemctl reload nginx
If your distribution's nginx links an older OpenSSL, either install a build against 3.5 or later, or terminate TLS at a component that supports the hybrid, such as a CDN or cloud load balancer.
Caddy
Caddy's tls directive has a curves option whose accepted values include x25519mlkem768, the only post-quantum value, alongside x25519, secp256r1, secp384r1 and secp521r1 (Caddy docs). The documentation recommends not changing the defaults. Caddy is a Go program, and Go 1.24 and later enable the hybrid by default in crypto/tls (Go 1.24 notes), so a recent Caddy built with a recent Go should offer it without configuration. We did not run Caddy. If you want it explicit (untested):
example.com {
tls {
curves x25519mlkem768 x25519 secp256r1
}
}
Check your Caddy version's release notes and verify with the command in step 0.
Go services
Go 1.24 and later enable X25519MLKEM768 by default when Config.CurvePreferences is nil. The notes also document the opt-out GODEBUG=tlsmlkem=0, useful against buggy servers that mishandle large records and time out the handshake (Go 1.24 notes). If you set CurvePreferences yourself, add tls.X25519MLKEM768 to it, or you will silently turn the default off.
Cloud load balancers
AWS. Elastic Load Balancing policies with PQ in the name offer hybrid key exchange on TLS 1.3. AWS recommends ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09, or the FIPS variant ELBSecurityPolicy-TLS13-1-2-Res-FIPS-PQ-2025-09. The hybrid policies support X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024. Clients that cannot negotiate it, or connect with TLS 1.2, get a classical group. To attach the policy (standard CLI usage, not shown on that page; untested):
aws elbv2 modify-listener \
--listener-arn <listener-arn> \
--ssl-policy ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09
Note that the AWS documentation says the console default is that PQ policy, while the CLI, CloudFormation and CDK default is ELBSecurityPolicy-2016-08. Listeners you created by other means may not have it.
Google Cloud. Per Google's documentation, X25519MLKEM768 has been enabled by default since October 2026 on supported load balancers that have no SSL policy or one without a post-quantum setting. Setting post-quantum-key-exchange to DEFERRED in an SSL policy postpones it to October 2027. We recommend leaving it on.
Others. Check your provider's TLS policy documentation. The NCSC advice to understand your cloud provider's plans applies; see the migration plan.
Cloudflare reports it has had post-quantum encryption enabled for all websites and APIs since 2022 (source), so sites behind Cloudflare are covered from the client to Cloudflare. The connection from Cloudflare to your origin is a separate leg you need to configure.
What this does not cover
- Certificates. The hybrid protects the key exchange. Your server certificate is still RSA or ECDSA, and that is acceptable for now: signature forgery needs a quantum computer at connection time. See the threat chapter.
- The other legs. Origin connections, internal services, databases, VPNs and email servers each need their own check.
- Middleboxes. Some old inspection proxies and firewalls mishandle the larger ClientHello. Roll out to a canary first, and compare handshake failure rates.
Verify, then monitor
- Re-run the
openssl s_clientcommand. ExpectX25519MLKEM768. - Test with a current browser, and with the clients that matter to you (API consumers, mobile apps, monitoring probes).
- Watch handshake errors and latency for a week.
- Put the check in monitoring so a library upgrade cannot silently turn it off.
Next steps
Run the post-quantum TLS check against your public hostnames, and explore the key exchange in the KEM playground. For SSH, see post-quantum SSH. If you want a review of your TLS termination points or help with a staged rollout, you can contact a specialist via /en/contact.