Post-quantum TLS on Apache, NGINX, LiteSpeed and Cloudflare: what to change and how to test it

Not technical? Start with what the NSA advisory means for your business. It explains the risk in plain terms and what to ask of your team. This post is the detail for the people who run the servers.

The NSA has told its own systems to move to post-quantum cryptography now. For most businesses the first practical step is the web server, and it is smaller than it sounds. On current software it may already be done. This post covers what to change on Apache, NGINX, LiteSpeed and Cloudflare, how to test it, and what the change does and does not protect.

What you are turning on

A TLS connection does two jobs. It agrees a secret key between browser and server, and it proves the server is who it claims to be. A future quantum computer threatens both, but only the first can be attacked in advance: someone records your traffic today and decrypts it when the capability exists.

The fix for that is a hybrid key exchange called X25519MLKEM768. It runs the X25519 exchange every server uses today alongside ML-KEM-768, one of the post-quantum algorithms NIST standardised in 2024. An attacker has to break both. It only exists in TLS 1.3.

Two things people try first do nothing for this risk. A new certificate changes nothing about the key exchange. Moving from RSA-2048 to RSA-4096 makes the certificate bigger and leaves the same weakness in place.

The requirement is OpenSSL 3.5, in the right place

Apache and NGINX leave cryptography to OpenSSL. OpenSSL 3.5, a long-term support release from April 2025, is the first version with ML-KEM built in. What matters is the OpenSSL your web server was built against. Installing a newer openssl command next to an old server changes nothing.

Check before you edit anything. For NGINX, nginx -V prints a line such as “built with OpenSSL 3.5.7”. For Apache, the startup line in the error log names the OpenSSL version it loaded. Many long-term support distributions still ship OpenSSL 3.0. Ubuntu 24.04 is one. On those, the route is a newer distribution release, the vendor’s own package repository, or a container image.

NGINX

If NGINX is built with OpenSSL 3.5 and your configuration has no ssl_ecdh_curve line, you are finished. We tested the stock nginx:alpine image with nothing set beyond a certificate and TLS 1.3, and it negotiated X25519MLKEM768 with a current client.

If you do have an ssl_ecdh_curve line, it overrides the default list, and an old one will silently keep the hybrid group out. Put it first:

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

Run nginx -t before you reload. An NGINX built on older OpenSSL does not know the name and will refuse the configuration.

Apache

The same rule applies, and we tested it the same way on the stock httpd:2.4 image. With OpenSSL 3.5 and no group list of your own, Apache negotiates the hybrid group by default. With an old list in place it fell back to plain X25519. If your configuration sets a list, update it:

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

Run apachectl configtest first, for the same reason.

LiteSpeed

LiteSpeed does not use the system OpenSSL, so the version of the server itself is what counts. LiteSpeed Web Server 6.3.7, released on 23 September 2026, added post-quantum key exchange. Upgrade to that version or later and keep TLS 1.3 enabled. At the time of writing, the OpenLiteSpeed 1.8 release notes do not mention it, so test an OpenLiteSpeed server before you assume it is covered.

Cloudflare

A site behind Cloudflare has two connections, and they are protected separately.

Visitor to Cloudflare. Every site served through Cloudflare over TLS 1.3 has supported the hybrid exchange since October 2022. There is nothing to switch on beyond TLS 1.3 itself. Whether a given visit uses it depends on the visitor’s browser.

Cloudflare to your server. This is controlled by a setting called Automatic key exchange, under SSL/TLS, Overview, “Origin connection & post-quantum encryption”. It is on by default. Cloudflare checks your origin about once a day, and when the origin supports the hybrid group it moves traffic over in stages. For it to apply, the zone must be in Full or Full (strict) mode and the origin must accept TLS 1.3. So the work here is on your server, using the sections above.

Two cautions. The same panel offers a “Post-quantum hybrid” compliance requirement. Selecting it makes Cloudflare refuse any origin that lacks support, and visitors see a 525 error, so leave it alone until every origin is ready. And if your origin connects through Cloudflare Tunnel, this setting does not apply. The tunnel has its own post-quantum connection to Cloudflare.

How to test

You need OpenSSL 3.5 or later on the machine you test from. Offer only the hybrid group and see whether the server accepts:

openssl s_client -connect example.com:443 -servername example.com \
  -tls1_3 -groups X25519MLKEM768 </dev/null | grep Negotiated

A server that supports it prints “Negotiated TLS1.3 group: X25519MLKEM768”. A server that does not fails the handshake. The port is required. Without :443 the command fails before it reaches the server, and the error is easy to mistake for a server that lacks support.

Behind Cloudflare, that command tests Cloudflare. To test your own server, put its IP address in -connect and keep your domain in -servername.

What this does not cover

  • TLS 1.2 connections. It is reasonable to keep TLS 1.2 for old clients, but those connections use the classical exchange. In our test the same server fell back to plain X25519 the moment the client asked for TLS 1.2.
  • Certificates. Proof of identity still rests on RSA or elliptic curve signatures. Publicly trusted certificates with post-quantum signatures such as ML-DSA need certificate authorities and browsers to support them first. Keep your current certificates.
  • Old network equipment. The hybrid exchange makes the first message of the handshake large enough to span two network packets. Some older load balancers, firewalls and inspection proxies handle that badly. Test through the real network path before a wide rollout.
  • Everything that is not a website. VPNs, email transport, database connections, API calls your own software makes, and backups each need the same question asked. SSH is ahead: OpenSSH has used a hybrid post-quantum exchange by default since version 9.0.

Where to start

Run the test against every public hostname you own and write down the result. The servers that pass need nothing. The ones that fail tell you which machines are on old software, and that list is worth having for more reasons than this one. Fix those through your normal change process, test again, and record the date. That record is the first entry in the cryptography inventory the NSA advisory asks for.