Post-quantum TLS on nginx needs less work than you might expect. When nginx or Angie runs on OpenSSL 3.5 or later, the hybrid key exchange group X25519MLKEM768 is on without any configuration.
In short: you need no config line for it. A pinned ssl_ecdh_curve list can weaken the hybrid group or switch it off, and the server reports no error. The check that many guides copy no longer works, so this article shows two that do.
What post-quantum TLS protects against
A TLS 1.3 connection starts with a key exchange, in which client and server agree on the session keys. The classical method is elliptic-curve Diffie-Hellman, for example on the X25519 curve. Shor’s algorithm, run on a large enough quantum computer, would break that key exchange.
The first half of the attack needs no such machine. RFC 9954 calls the threat retroactive decryption, also known as harvest now, decrypt later. An adversary who has passively recorded handshakes and encrypted traffic can decrypt them once such a machine exists.
The defence is a key exchange for which no efficient quantum attack is known. NIST standardised one as FIPS 203: ML-KEM, the Module-Lattice-Based Key-Encapsulation Mechanism. It is Kyber with minor technical changes and a new name. Those changes make it incompatible with the Kyber versions deployed before it.
ML-KEM is newer than X25519, so TLS does not lean on it alone. A hybrid key exchange runs both side by side and derives the keys from both. RFC 9954 states the goal: the shared secret stays secure as long as one of the two remains unbroken. An attacker has to break both.
In TLS 1.3 this hybrid is a key exchange group, not a cipher suite. Its name is X25519MLKEM768, and RFC 10024 gives it the number 4588, or 0x11EC. This article calls that kind of key exchange hybrid and plain X25519 classical.
What you need: OpenSSL 3.5 or later under nginx or Angie
Neither nginx nor Angie needs a patch or an extra module for the hybrid group. The support sits in the OpenSSL library that the server is linked to. OpenSSL 3.5.0, released on 8 April 2025, added ML-KEM and changed its default group list to include and prefer the hybrid groups.
So the question is which OpenSSL your server runs on, and that depends on the release. The last two columns say whether the hybrid group is available.
| Release | System OpenSSL | Distribution nginx | Our packages |
|---|---|---|---|
| Debian 12 | 3.0.20 | no | yes |
| Debian 13 | 3.5.9 | yes | yes |
| Ubuntu 22.04 | 3.0.2 | no | yes |
| Ubuntu 24.04 | 3.0.13 | no | yes |
| Ubuntu 26.04 | 3.5.5 | yes | yes |
The nginx and angie packages from our repository do not use the distribution’s library. Both depend on libssl-nginx, our own OpenSSL build, and apt installs it along with them. That library is at version 4.0.3 now, but the hybrid group arrived with 3.5, not with 4.0.
The background is in openssl-nginx: a dedicated OpenSSL build for nginx and Angie and in OpenSSL 4.0 nginx upgrade: what changed from 3.5 and what can break.
To see what your server is linked to, run nginx -V or angie -V. The output of nginx has a line that starts with built with OpenSSL and names the version. When the library loaded at run time is a different one, a running with OpenSSL note follows on that line.
Post-quantum TLS on nginx works without a config line
The ssl_ecdh_curve directive sets the groups the server supports, and its default is auto. The nginx documentation describes auto as a list built into the OpenSSL library. The source of nginx shows that it then sets no list of its own. Angie has the same directive with the same default.
Since OpenSSL 3.5 that built-in list starts with the hybrid group. A server block for hybrid key exchange therefore looks like any other:
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
# TLS 1.3 carries the hybrid group; TLS 1.2 stays for older clients
ssl_protocols TLSv1.2 TLSv1.3;
# No ssl_ecdh_curve line. Its default, auto, leaves the group list
# to OpenSSL, and OpenSSL 3.5 and later put X25519MLKEM768 first.
}
The hybrid group exists in TLS 1.3 only. That protocol is on by default, because ssl_protocols defaults to TLSv1.2 TLSv1.3. Clients that speak only TLS 1.2 keep working with a classical key exchange.
Chrome has sent a hybrid ML-KEM key share since Chrome 131. Firefox added the group in Firefox 132, released on 29 October 2024. If your server runs on OpenSSL 3.5 or later and nothing pins the list, those visitors already get a hybrid key exchange.
The curve list that weakens it
Many TLS guides, an earlier version of this one included, tell you to add a list such as X25519MLKEM768: to ssl_ecdh_curve. On OpenSSL 3.5 or later that line is weaker than no line at all. The advice here is to delete it and let auto do the work.
An older hardening list does more damage. A line such as ssl_ecdh_curve X25519:prime256v1:secp384r1; does not name the hybrid group at all, so it switches the hybrid off for every visitor.
Start by finding out whether your configuration has a line of either kind: grep -rn ssl_ecdh_curve /etc/nginx/, or /etc/angie/ for Angie.
Why a flat list is weaker
The reason lies in how OpenSSL 3.5 picks a group. OpenSSL’s documentation describes the group list as a series of tuples, separated by /. The server walks the tuples in order and stops at the first one that holds a group the client supports.
Inside that tuple, a group for which the client already sent a key share wins. When the client sent no share for any group in the tuple, the server answers with a HelloRetryRequest and asks for one. That costs one extra round trip.
The built-in default of OpenSSL 3.5 puts the hybrid group in a tuple of its own, then X25519 and secp256r1, then the larger curves. OpenSSL 4.0 adds two more hybrid groups to that first tuple. A flat list with colons is one single tuple. That leaves three kinds of client:
- A client that supports the hybrid group and sends its key share, as Chrome and Firefox do, gets
X25519MLKEM768either way. - A client that supports the hybrid group but sends only an X25519 key share is asked for the hybrid share by the default list. With the flat list it gets classical X25519, without a retry and without a warning.
- A client without ML-KEM support, or one on TLS 1.2, gets a classical key exchange either way.

Clients of the second kind exist by design. OpenSSL’s documentation describes how a client can hold the large hybrid share back until a server asks for it. Postfix 3.11 does that by default, as described in Postfix 3.11: post-quantum TLS, TLSRPT and milters.
If you must keep a list
Some set-ups cannot do without a list, for instance because a policy pins the curves. In that case keep the tuple separator. Per OpenSSL’s documentation, the form X25519MLKEM768/ leaves the hybrid group in a tuple of its own:
server {
listen 443 ssl;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
# Only if you must pin the list. Needs OpenSSL 3.5 or later.
# The "/" keeps the hybrid group in a tuple of its own, so the
# server asks a capable client for it instead of settling for X25519.
ssl_ecdh_curve X25519MLKEM768/X25519:secp256r1:secp384r1;
}
That line needs OpenSSL 3.5 or later. An older library does not know the group name, so the list fails to parse and nginx refuses the configuration. The error reads SSL_CTX_set1_curves_list(.
Any pinned list also has to cover your certificate. The nginx documentation says that for ECDSA certificates to work, the list must include the curves used in them. The same list can also be set with ssl_conf_command Groups, so set it in one place and never in both.
Check which group was negotiated
After a change, test the configuration with nginx -t or angie -t, then reload with nginx -s reload. After that, look at what clients negotiate. There are two ways to do it, and the first needs no special client.
In the access log
The server can record the group of every handshake. The $ssl_curve variable holds it, and a small log format puts it next to the protocol and the cipher suite:
# http context
log_format tlsgroup '$remote_addr $ssl_protocol $ssl_cipher $ssl_curve "$http_user_agent"';
# server context
access_log /var/log/nginx/tls-group.log tlsgroup;
A hybrid handshake shows up as X25519MLKEM768. Any other value, such as a plain X25519, is a classical handshake. After some real traffic, / shows which visitors got the hybrid group and which did not.
The source of nginx shows that it asks OpenSSL for the group name and falls back to a hexadecimal number. The changelog lists a fix in that code for nginx 1.27.5, so an older build may log 0x11ec. That is the same group by its number.
Angie has the same variable and logs the name, or its number 0x11ec. On Angie the log file belongs under /var/log/angie/.
With openssl s_client
The check that many guides copy is to grep the output of openssl s_client for Server Temp Key. It cannot work any more. According to OpenSSL’s source, version 3.5 prints Peer Temp Key instead. For a hybrid handshake it prints a different line, Negotiated TLS1.3 group.
The version of the client matters as well. An openssl command older than 3.5 cannot offer the hybrid group, so it reports X25519 against a correctly configured server. Use a client of 3.5 or later and match both lines:
# The client must be OpenSSL 3.5 or later (Debian 13, Ubuntu 26.04).
# An older openssl cannot offer the hybrid group and always shows X25519.
openssl version
openssl s_client -connect yourdomain.com:443 -tls1_3 </dev/null 2>&1 | grep -E "Negotiated TLS1.3 group|Temp Key"
# Hybrid key exchange:
# Negotiated TLS1.3 group: X25519MLKEM768
# Classical key exchange:
# Peer Temp Key: X25519, ...
On Debian 12 and on Ubuntu 22.04 and 24.04 the openssl command is version 3.0. Our libssl-nginx package ships no openssl command, so installing our packages does not change that. Run the check from a Debian 13 or Ubuntu 26.04 machine, or rely on the access log.
Rollout steps
On an existing server the whole job is five steps:
- Check which OpenSSL the server is linked to with
nginx -Vorangie -V. It has to be 3.5 or later. On Debian 12 and Ubuntu 22.04 or 24.04 the distribution’s nginx cannot offer the hybrid group, and our packages can. - Search the configuration for
ssl_ecdh_curve. Delete the line, or change it to the tuple form if you must keep a list. - Test the configuration with
nginx -tand reload. - Add
$ssl_curveto a log format and switch that log on. - Look at the log once real traffic has come in. Visitors on a current Chrome or Firefox should show
X25519MLKEM768.
What it costs
The hybrid group makes the first two messages of the handshake larger. RFC 10024 gives the sizes: the client’s key share is 1216 bytes and the server’s is 1120 bytes. A plain X25519 share is 32 bytes each way.
The large ClientHello is where trouble can start. OpenSSL’s documentation warns that it may no longer fit in a single TCP segment, and that firewall software may then erroneously disrupt the handshake. That is a fault on the network path, not in your server. It is also why some clients hold the share back.
Such a client pays one extra round trip for the HelloRetryRequest when it meets a server on the default list. Clients without the hybrid group notice nothing, because they negotiate a classical group as before.
After the handshake nothing differs. The group only decides how the keys are agreed. The records are then encrypted with the negotiated cipher suite, as with a classical key exchange.
Certificates come later
Hybrid key exchange protects the session keys. The certificate that proves who your server is still carries a classical signature, such as ECDSA or RSA. RFC 9954 explains why that can wait: session authentication cannot be retroactively broken. An attacker would have to break the signature while the connection is being set up.
The post-quantum signature standards are ML-DSA and SLH-DSA, and OpenSSL 3.5 supports both. For a lab you can make a self-signed ML-DSA certificate with the openssl command of OpenSSL 3.5 or later. That is the distribution’s own command on Debian 13 or Ubuntu 26.04.
# Generate an ML-DSA-65 private key (post-quantum signature algorithm)
openssl genpkey -algorithm ML-DSA-65 -out pqc_key.pem
# Create a certificate signing request
openssl req -new -key pqc_key.pem -out pqc.csr -subj "/CN=yourdomain.com"
# Self-sign the certificate
openssl x509 -req -days 365 -in pqc.csr -signkey pqc_key.pem -out pqc_cert.pem
# Use it in NGINX
# ssl_certificate /etc/nginx/certs/pqc_cert.pem;
# ssl_certificate_key /etc/nginx/certs/pqc_key.pem;
Treat this as a lab exercise. No browser trusts a self-signed certificate, so a production site keeps its normal certificate. Its post-quantum protection comes from the key exchange.
Related reading
The rest of the TLS set-up is in nginx TLS configuration for an SSL Labs A+: what the grade checks. For Angie itself there is the Angie web server guide: ACME, monitoring and moving from nginx. The same key exchange on a mail server is covered in our article on post-quantum TLS on Dovecot. For a code its users thought was safe, read how Bletchley Park broke Enigma.
Correction, 25 November 2026. An earlier version of this article called X25519MLKEM768 a cipher suite, recommended a flat ssl_ecdh_curve list, tied ML-KEM to “openssl-nginx 4.0” and checked the result with a grep for Server Temp Key. It was corrected from OpenSSL’s documentation, release notes and source, the nginx documentation and source, RFC 9954 and RFC 10024.