PQC Gate

Guides › How to enable post-quantum TLS on nginx, Apache, HAProxy and Caddy

How to enable post-quantum TLS on nginx, Apache, HAProxy and Caddy

Updated 2026-12-05

Turning on post-quantum key exchange is usually a library upgrade plus one configuration line. The group to enable is X25519MLKEM768. Keep X25519 after it, so clients without post-quantum support can still connect.

Step 0: the TLS library decides

Your web server can only offer groups its TLS library knows. For servers that use OpenSSL (nginx, Apache, HAProxy), that means OpenSSL 3.5 or later. Check which library your server was built against, not just what openssl version says on the host:

nginx -V 2>&1 | grep -i openssl
httpd -V | grep -i ssl          # or apache2 -V
haproxy -vv | grep -i openssl

Many long-term-support Linux releases ship an older OpenSSL. If yours does, use a distribution release that ships 3.5, an official or vendor build linked against 3.5 or later (or AWS-LC or BoringSSL), or terminate TLS on a CDN or load balancer that already supports the group.

nginx

With nginx linked against OpenSSL 3.5 or later, set the groups in the http or server block:

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

Despite its name, ssl_ecdh_curve sets the list of TLS groups, hybrids included. Reload with nginx -t && nginx -s reload. If nginx -t rejects the group name, nginx is linked against an older library.

Apache httpd (mod_ssl)

SSLProtocol -all +TLSv1.2 +TLSv1.3
SSLOpenSSLConfCmd Groups X25519MLKEM768:X25519:prime256v1

Put it in the virtual host or the global SSL configuration, then run apachectl configtest and reload.

HAProxy

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

Or set curves X25519MLKEM768:X25519:P-256 on an individual bind line. HAProxy has to be built with OpenSSL 3.5 or later, or with AWS-LC.

Caddy and other Go servers

Go's crypto/tls enables X25519MLKEM768 by default from Go 1.24. A current Caddy release negotiates it with no configuration. For your own Go services, building with Go 1.24 or later is enough, unless you set tls.Config.CurvePreferences explicitly. In that case, add tls.X25519MLKEM768 to the list.

CDNs and managed load balancers

If a CDN or cloud load balancer terminates TLS, browsers only ever talk to it. Many large CDNs negotiate X25519MLKEM768 with browsers already, and cloud providers have added post-quantum TLS policies to their load balancers. Check your provider's list of security policies, and remember there are two legs: browser → edge, and edge → your origin. The second leg needs the origin to support the group as well.

Verify

openssl s_client -connect your.host:443 -servername your.host \
  -groups X25519MLKEM768 </dev/null 2>&1 | grep "Negotiated TLS1.3 group"

Expect X25519MLKEM768. More ways to test are in how to check if your server supports post-quantum TLS.

Things that go wrong

Check it with PQC Gate

Our free endpoint check reports, for one hostname, whether the server negotiates X25519MLKEM768, whether it still accepts legacy TLS, and what its certificate uses. For your own code and servers, the $299 audit inventories every quantum-vulnerable algorithm and hands you a CycloneDX CBOM and a fix plan.

Run the free check Request an audit See a sample report

More guides