nginx uses whatever key exchange groups its OpenSSL library offers. OpenSSL 3.5 added X25519MLKEM768 and puts it first in its default list, so an nginx built against 3.5 is post-quantum ready unless the config pins an older list.
Requirements
- nginx built against OpenSSL 3.5.0 or newer. What counts is the library nginx was built with, not the openssl command on the server.
- TLS 1.3 enabled (it is in the default ssl_protocols of current nginx).
- Distribution packages follow the system OpenSSL. Older releases such as Debian 12 and Ubuntu 24.04 ship OpenSSL 3.0, so you need a newer OS release, the official nginx.org packages built for one, or a container image based on it.
Look at the “built with OpenSSL” line:
nginx -V 2>&1 | grep -i opensslTurn it on
If your config has no ssl_ecdh_curve line, there is nothing to do after the upgrade. If it has one, add the hybrid group in front:
nginx.conf (server or http block)
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;Test the config and reload:
nginx -t && nginx -s reloadCheck that it worked
Run the checker against your hostname. It reports X25519MLKEM768 as supported once the change is live.
From a terminal, with an OpenSSL 3.5+ client. Output that names X25519MLKEM768 means it works, a handshake failure alert means it does not:
openssl s_client -connect example.com:443 -servername example.com \
-tls1_3 -groups X25519MLKEM768 </dev/null 2>&1 | grep -iE 'group|alert'Common problems
- nginx -t fails with an SSL_CTX_set1_curves_list error: nginx is still linked against OpenSSL older than 3.5.
- An old ssl_ecdh_curve line copied from a hardening guide (for example secp384r1 only) silently turns post-quantum off.
- Servers limited to TLS 1.2 cannot negotiate it at all.