Enable X25519MLKEM768 on nginx
nginx gets post-quantum key exchange from the OpenSSL it's built with. With OpenSSL 3.5 or later, X25519MLKEM768 is on by default; you only need to make sure your configuration doesn't switch it off.
Before you start
- nginx built with OpenSSL 3.5 or later. Check with
nginx -V 2>&1 | grep -i openssl. The officialnginx:1.29-alpineimage uses OpenSSL 3.5. - TLS 1.3 enabled: post-quantum key exchange needs it.
Option 1: use OpenSSL's defaults (simplest)
- Find any
ssl_ecdh_curveline in your configuration:grep -rn ssl_ecdh_curve /etc/nginx/. - Remove it, or set it to
auto. OpenSSL 3.5's default list puts X25519MLKEM768 first. - Make sure TLS 1.3 is allowed:
ssl_protocols TLSv1.2 TLSv1.3;
- Test and reload:
nginx -t && nginx -s reload.
Option 2: list the groups yourself
Use this if you need a fixed list, for example to keep a classical fallback in a known order.
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1;
Keep X25519MLKEM768 first: if X25519 comes first, browsers that offer both get classical key exchange (our checker shows this as "supported, not preferred").
Test and reload: nginx -t && nginx -s reload.
Check from the command line
With OpenSSL 3.5 on your machine:
openssl s_client -connect yourdomain.com:443 -servername yourdomain.com -groups X25519MLKEM768 </dev/null 2>/dev/null | grep -i "group"
Then scan your domain below to check every host at once.