X25519MLKEM768: Enable PQ Key Exchange in nginx, Caddy, Go

, by xura.tools team

TL;DR: X25519MLKEM768 is a hybrid key exchange that mixes classic X25519 with the post-quantum ML-KEM-768. Chrome and Firefox already offer it. On your server you often get it for free: nginx built with OpenSSL 3.5+, Caddy and Go 1.24+ all enable it by default. The most common reason it's off is an old hardcoded curve list. Test with openssl s_client -groups X25519MLKEM768 -tls1_3 -connect yoursite.com:443 </dev/null 2>/dev/null | grep Negotiated.

Why this matters now

On December 3, 2026, Chrome announced it will stop trusting P-256 CA keys from March 15, 2027 (our explainer). In same post, Chrome asked site operators to adopt hybrid ML-KEM key agreement, X25519MLKEM768.

The two things solve different problems:

Key exchange is the urgent one for a simple reason. Someone can record encrypted traffic today and decrypt it years later if the key exchange is ever broken. Cloudflare put it well in its Project Quantum Leap post: "Encryption protects what you send. Authentication proves who you're talking to."

What X25519MLKEM768 is

It's a TLS 1.3 key exchange group defined in the IETF draft draft-ietf-tls-ecdhe-mlkem. Both sides do an X25519 exchange and an ML-KEM-768 exchange, and the results are combined. If either one holds, the connection is safe.

Some numbers from the draft:

Browser support is already wide. Chrome switched from the older Kyber draft to ML-KEM in 2024 (Google's post). Mozilla says Firefox prefers X25519MLKEM768 where possible and that 52% of Firefox TLS handshakes are already protected. Cloudflare says about 73% of browser connections to it are post-quantum encrypted.

So the missing piece is usually your server.

Test your site first

You need an OpenSSL 3.5 or newer client. The openssl on macOS is LibreSSL and won't work. On a Mac, brew install openssl gives you a recent one.

openssl version
openssl s_client -groups X25519MLKEM768 -tls1_3 -connect example.com:443 -servername example.com \
  </dev/null 2>/dev/null | grep Negotiated

If it works you'll see:

Negotiated TLS1.3 group: X25519MLKEM768

If the server doesnt support it, the handshake fails, because you only offered the hybrid group. That's what you want for a test.

We ran this on December 5, 2026. google.com and cloudflare.com negotiated X25519MLKEM768. github.com failed the hybrid-only handshake, so it didn't support the group at the time of our test.

To see what a normal client gets (hybrid plus fallback), drop -groups:

openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null \
  | grep -E "Negotiated|Protocol"

In Chrome, open DevTools, go to the Privacy and security panel and look at the connection details. It lists the key exchange group used.

nginx

Step 1: check which OpenSSL nginx uses

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

You need OpenSSL 3.5 or newer. The nginx blog shows that the version nginx was built with and the one it runs with can differ, so check both lines if you see two.

Some examples from the nginx blog and gixy's notes:

If you're on OpenSSL 3.0, the clean fix is a newer OS or an nginx build linked to OpenSSL 3.5. The nginx blog mentions the OQS provider as a workaround on 3.0, but calls it experimental and not for production.

Step 2: don't block it with an old curve list

With OpenSSL 3.5, nginx uses OpenSSL's default group list when ssl_ecdh_curve is not set. That list starts with X25519MLKEM768. So the easiest config is no config.

Find any hardcoded list:

grep -rn "ssl_ecdh_curve" /etc/nginx/

A line like this, common in old templates, turns the hybrid off:

ssl_ecdh_curve X25519:prime256v1:secp384r1;

Either delete it, or put the hybrid first:

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

The nginx blog also shows the OpenSSL 3.5 tier syntax, where ? skips unknown groups and / starts a lower priority tier:

ssl_ecdh_curve ?X25519MLKEM768/X25519:secp384r1:prime256v1;

Only use these lines on OpenSSL 3.5+. On older OpenSSL, nginx -t fails with an error that the group can't be set.

Keep TLS 1.3 on. The hybrid only works with TLS 1.3. Clients that don't support it fall back to classic groups.

Step 3: RHEL 9 family

The nginx blog notes that the system crypto policy on RHEL 9, Alma and Rocky 9 leaves the hybrid out. Turn it on, then restart nginx:

sudo update-crypto-policies --set DEFAULT:PQ
sudo systemctl restart nginx

Step 4: reload and test

sudo nginx -t && sudo systemctl reload nginx
openssl s_client -groups X25519MLKEM768 -tls1_3 -connect example.com:443 -servername example.com \
  </dev/null 2>/dev/null | grep Negotiated

Caddy

Caddy is written in Go and uses Go's TLS defaults. Since Go 1.24, X25519MLKEM768 is on by default, so a current Caddy release supports it with no config.

The Caddy tls docs list x25519mlkem768 as a supported value for curves and say "It is recommended to not change the defaults." If you did set curves in the past, either remove it or put the hybrid first:

example.com {
	tls {
		curves x25519mlkem768 x25519
	}
}

Check your version with caddy version, then reload and run the openssl test.

Go

Go's crypto/tls enables X25519MLKEM768 by default since Go 1.24, when Config.CurvePreferences is nil. The current defaults source puts X25519MLKEM768 first, then X25519 and the NIST curves.

The simplest server is one that doesn't set curves at all:

srv := &http.Server{
	Addr:      ":443",
	TLSConfig: &tls.Config{}, // CurvePreferences nil: Go defaults, hybrid first
}
log.Fatal(srv.ListenAndServeTLS("fullchain.pem", "privkey.pem"))

If you must set the list, keep the hybrid in it:

TLSConfig: &tls.Config{
	CurvePreferences: []tls.CurveID{tls.X25519MLKEM768, tls.X25519, tls.CurveP256},
},

Two gotchas:

Behind a CDN

If your site is behind Cloudflare or another CDN, browsers do the key exchange with the CDN, not with you. Cloudflare has used post-quantum key exchange for visitors by default for years. The connection from the CDN to your origin is a separate hop. Cloudflare says it supports post-quantum encryption to origins too, so it's worth turning on at your origin as well.

Things that can break

FAQ

What does X25519MLKEM768 protect against?

It protects session keys from future quantum attacks, the "record now, decrypt later" risk. It doesn't change your certificate.

Is X25519MLKEM768 slower than X25519?

The key shares are bigger: 1216 bytes from the client and 1120 bytes from the server, against 32 bytes each for X25519. ML-KEM itself is fast. Big sites like Google and Cloudflare run it by default.

Is X25519MLKEM768 a cipher suite?

No. It's a key exchange group. Your TLS 1.3 cipher suites (like TLS_AES_128_GCM_SHA256) stay the same.

Do I need OpenSSL 3.5 for nginx?

For built-in support, yes. OpenSSL 3.5 added ML-KEM and enabled the hybrid by default.

Does this fix the Chrome P-256 problem?

No. That's about your CA chain. Use our P-256 checker and the fix guide for that. You should do both.

How do I test without a terminal?

Open your site in Chrome and look at the connection details in DevTools. More free checks are on our tools page.


Is your site affected? Run the free P-256 check.