Post-quantum TLS on nginx, HAProxy and other OpenSSL servers

On this page
  1. The 30-second check
  2. nginx
  3. HAProxy
  4. Apache httpd
  5. Load balancers and CDNs
  6. Verify from the outside
  7. Large ClientHello and middleboxes

Short answer: Any TLS server linked against OpenSSL 3.5 or later offers the hybrid post-quantum group X25519MLKEM768 by default; OpenSSL 3.5's default key shares are X25519MLKEM768 and X25519. For nginx, HAProxy, Apache and Postfix the work is: make sure the server binary links OpenSSL 3.5+, and remove any curve list that pins classical groups. No new certificates are needed.

The 30-second check

nginx -V 2>&1 | grep -i "openssl"                # "built with" and "running with" versions
haproxy -vv | grep -i "openssl"
grep -rn "ssl_ecdh_curve\|curves\|ssl-default-bind-curves\|SSLOpenSSLConfCmd" /etc/nginx /etc/haproxy /etc/apache2 2>/dev/null

Two things to read carefully:

nginx

With OpenSSL 3.5+ and ssl_ecdh_curve at its default (auto), nginx already offers the hybrid group. If you pin curves, put the hybrid first and keep classical fallbacks:

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

The directive is passed to OpenSSL as a group list, so any OpenSSL 3.5 group name works. On an older OpenSSL, X25519MLKEM768 is unknown and nginx -t fails, which is a useful safety net. Reload with nginx -t && nginx -s reload.

HAProxy

global
    ssl-default-bind-curves X25519MLKEM768:X25519:P-256:P-384

Or per bind line with the curves keyword. Leave both unset to use the OpenSSL defaults, and make sure HAProxy itself runs with OpenSSL 3.5+.

Apache httpd

SSLOpenSSLConfCmd Groups X25519MLKEM768:X25519:prime256v1:secp384r1

Load balancers and CDNs

If TLS terminates at a managed load balancer or CDN, its configuration decides what browsers negotiate. Several CDNs already negotiate X25519MLKEM768 with browsers by default; Cloudflare Radar reports that most human HTTPS traffic it sees is now post-quantum. Check two hops separately:

  1. Browser to edge: test from outside with the commands below.
  2. Edge to origin: often still classical. Look for an origin post-quantum setting in your provider, and make sure the origin server itself (nginx, your app) supports the hybrid group.

Verify from the outside

openssl s_client -connect example.com:443 -groups X25519MLKEM768 </dev/null 2>/dev/null | grep -i group
openssl s_client -connect example.com:443 -groups X25519 </dev/null 2>/dev/null | grep -i group   # classical fallback still works

Your test client also needs OpenSSL 3.5+, or it can't offer the group. More in How to check if a server uses post-quantum TLS.

Large ClientHello and middleboxes

A hybrid key share adds about 1.2 KB to the ClientHello, so it often spans two TCP packets. Correct TLS stacks handle this; some old firewalls, IDS appliances and TLS-inspecting proxies did not, which shows up as connections that hang or reset only for hybrid-capable clients. If you see that, fix or update the middlebox rather than turning off the hybrid group. See X25519MLKEM768 explained.

pqshift detects pinned curve lists in nginx, Caddy and HAProxy configs and OpenSSL versions in Dockerfiles, and adds a CI check that proves the hybrid handshake on every change.

FAQ

How do I enable post-quantum TLS in nginx?

Run nginx linked to OpenSSL 3.5+. With ssl_ecdh_curve left at auto, X25519MLKEM768 is offered by default. If you pin curves, use ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;

Does post-quantum TLS need new certificates?

No. Hybrid key exchange changes only the key agreement. Your existing RSA or ECDSA certificates keep working; post-quantum certificates are a separate, later step.

Sources