December 3, 2026
12 min read time

Getting Varnish ready for post-quantum TLS

On December 2, the NSA advised owners, operators and vendors of National Security Systems to immediately accelerate the transition to post-quantum cryptography. If you terminate TLS in Varnish Enterprise, the good news is that you may already be most of the way there. Whether you are depends on two things: the OpenSSL version on the host, and a few lines in your TLS configuration file.

TL;DR: Run Varnish on a system with OpenSSL 3.5 or newer, and make sure ecdh-curve in /etc/varnish/tls.cfg either is unset or includes X25519MLKEM768. On RHEL 9, also enable the PQ crypto subpolicy. If you need to follow CNSA 2.0, use the stricter profile at the end of this post.

Why now

The NSA's press release is direct: "Adversaries are already collecting encrypted information to decrypt once the capabilities become available." This is the "harvest now, decrypt later" problem. Traffic recorded today can be decrypted years from now, so the key exchange protecting it needs to be quantum resistant today, not when large quantum computers arrive.

The accompanying advisory, "Immediate Actions to Push Toward Post-Quantum", puts TLS near the top of the list. Its second action is to "Move TLS services to TLS 1.3 with approved crypto profiles", because "Updating TLS servers often delivers immediate risk reduction through configuration changes without waiting on major redesigns". The NSA also asks organizations to "identify quantum-vulnerable cryptographic dependencies" and to check with vendors about their PQC readiness. If Varnish terminates TLS for you, it is one of those dependencies, and this post is our answer.

The advisory is aimed at National Security Systems, but the reasoning applies to anyone whose traffic needs to stay confidential for years. Browsers already offer post-quantum key exchange by default, so for most sites the server side is the missing piece.

Two profiles

There are two ways to configure post-quantum TLS, depending on who your clients are.

Public-facing sites

  • Hybrid group X25519MLKEM768: ML-KEM (FIPS 203) plus classic X25519
  • Secure as long as either of the two holds up
  • Clients without post-quantum support fall back to classic key exchange

CNSA 2.0

  • ML-KEM-1024, AES-256, SHA-384
  • No fallback to weaker algorithms
  • Most browsers cannot connect: only for clients you control

The hybrid design also protects you if weaknesses are found in the newer algorithm. Most of this post covers the first profile. The CNSA 2.0 profile is described at the end.

What Varnish needs: the right platform

Varnish Enterprise uses the system OpenSSL library for TLS, both for client connections and for HTTPS backends. Support for ML-KEM arrived in OpenSSL 3.5, and no Varnish-specific changes are needed to use it. If the library supports the group and nothing in your configuration removes it, it gets negotiated. That makes the platform the deciding factor.

 
Platform OpenSSL version Post-quantum key exchange
RHEL / Alma / Rocky 10 3.5 Yes, by default
Debian 13 (trixie) 3.5 Yes, by default
Ubuntu 26.04 3.5 Yes, by default
RHEL / Alma / Rocky 9 3.5 Yes, after enabling the PQ subpolicy
Amazon Linux 2023 3.2 No
RHEL / Alma / Rocky 8 1.1.1.1 No
Debian 12 (bookworm) 3.0 No
Ubuntu 24.04 3.0 No

 

If you are on one of the platforms at the bottom of the list, the transition starts with an OS upgrade.

Step 1: Check your OpenSSL version

$ openssl version OpenSSL 3.5.4 30 Sep 2025 (Library: OpenSSL 3.5.4 30 Sep 2025)

On RHEL 9 and its rebuilds, older point releases ship OpenSSL 3.2. Update the system first:

$ sudo dnf update openssl openssl-libs crypto-policies

Step 2: Check ecdh-curve in your TLS configuration

The ecdh-curve setting in tls.cfg is the list of key exchange groups Varnish offers. If it is set, it replaces the OpenSSL default list. Earlier versions of the tls.cfg we ship, as well as our documentation, used this example:

ecdh-curve = "X25519:prime256v1:secp384r1"

This list leaves out the post-quantum group, so it turns post-quantum key exchange off even on OpenSSL 3.5. If you have this line, you have two options.

Remove it, or comment it out, and let OpenSSL decide. OpenSSL 3.5 already puts X25519MLKEM768 first in its default list, and on RHEL the system crypto-policy applies. This is now our recommended default, and the tls.cfg shipped in upcoming releases will leave ecdh-curve unset. Package upgrades do not replace a tls.cfg you already have, so existing installations need to make this change by hand either way.

Or set the current recommended list explicitly:

ecdh-curve = "X25519MLKEM768:X25519:prime256v1:secp384r1"

Only do this on hosts with OpenSSL 3.5 or newer. Older versions do not recognize the group name, reject the whole list, and Varnish fails to start. If you manage a mixed fleet with a single configuration file, leaving ecdh-curve unset is the safer choice.

Changes to tls.cfg take effect when Varnish is restarted:

$ sudo systemctl restart varnish

Step 3: RHEL 9 only, enable the PQ subpolicy

On RHEL 10, the default system crypto-policy already includes ML-KEM. On RHEL 9, it does not, even with OpenSSL 3.5 installed. Enable it with:

$ sudo update-crypto-policies --set DEFAULT:PQ $ sudo systemctl restart varnish

This affects every application on the host that follows the system crypto-policy, not only Varnish. Clients that do not support the post-quantum groups simply fall back to X25519 or one of the other classic groups.

Step 4: Verify

Use an OpenSSL 3.5 client to connect, and look at the negotiated group:

$ echo | openssl s_client -connect www.example.com:443 \     -servername www.example.com 2>/dev/null | grep 'Negotiated' Negotiated TLS1.3 group: X25519MLKEM768

If the command prints nothing, the connection used classic key exchange only. The full output then shows a line such as Peer Temp Key: X25519, 253 bits instead.

To check that the server really accepts the post-quantum group, rather than just falling back gracefully, restrict the client to that group only:

$ echo | openssl s_client -connect www.example.com:443 \     -servername www.example.com -groups X25519MLKEM768

If the handshake fails with a handshake failure alert, the group is not enabled on the server side. Check steps 1 to 3 again.

What about backends?

Backend TLS connections use the same OpenSSL library with its default groups and the system crypto-policy. If your origin supports X25519MLKEM768 and Varnish runs on one of the supported platforms, backend fetches use post-quantum key exchange too. There is no separate setting to configure. The ecdh-curve setting only applies to client-facing connections. To hold backend connections to a stricter profile, see signature algorithms and backend connections below.

What about certificates?

Post-quantum signatures (ML-DSA) protect the authentication part of the handshake rather than the encryption. They matter less for "harvest now, decrypt later", since a forged signature has to be created during the handshake, not years after it. They are still part of the transition, but browsers and public certificate authorities do not support ML-DSA certificates yet, so for public-facing sites the advice is to keep your ECDSA or RSA certificates for now.

The CNSA 2.0 profile

If you operate a National Security System, or need to meet the same requirements, the advisory is explicit that a post-quantum option alongside the old ones is not enough:

After upgrading, configure the product to exclusively use the approved cryptography profile. Do not leave non-PQC defaults in place.

It also calls for removing "all weaker elliptic-curve" options, and CNSA only approves P-384 and P-521 for elliptic-curve use. That rules out X25519, P-256 and ML-KEM-768. In Varnish this comes down to three settings:

tls-protos = TLSv1.3  ciphersuites = "TLS_AES_256_GCM_SHA384"  ecdh-curve = "SecP384r1MLKEM1024:MLKEM1024"

SecP384r1MLKEM1024 is the hybrid of ML-KEM-1024 and P-384, for deployments that follow the advisory's guidance on hybrid key exchange (IETF RFC 10024). MLKEM1024 is pure ML-KEM-1024. Keep the one, or both, that your accreditation calls for.

For the certificate, use ECDSA P-384 as an interim step, or ML-DSA-87 where your clients and PKI support it. Varnish Enterprise on OpenSSL 3.5 loads both. If you use RSA, see the next section: by default the TLS 1.3 handshake signature with an RSA key uses SHA-256, not the SHA-384 CNSA requires.

With this profile, clients that only offer X25519MLKEM768 or classic groups get a handshake failure alert, and TLS 1.2 clients get a protocol version alert. To verify:

$ echo | openssl s_client -connect nss.example.com:443 \     -servername nss.example.com -groups SecP384r1MLKEM1024 \     2>/dev/null | grep -E 'Negotiated|Cipher is|signature type' Peer signature type: ecdsa_secp384r1_sha384 Negotiated TLS1.3 group: SecP384r1MLKEM1024 New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384

Signature algorithms and backend connections

The settings above cover client-facing connections. Two more pieces are set through OpenSSL itself rather than tls.cfg: the signature algorithms allowed in the handshake, and everything about backend connections. Varnish uses the OpenSSL system defaults for both, so the profile goes there.

On RHEL 9 and 10, the supported way is a custom crypto-policy module:

# /etc/crypto-policies/policies/modules/CNSA2.pmod group@TLS = P384-MLKEM1024 MLKEM1024 sign@TLS = MLDSA87 ECDSA-SHA2-384 ECDSA-SHA2-512 RSA-PSS-RSAE-SHA2-384 RSA-PSS-RSAE-SHA2-512 RSA-PSS-SHA2-384 RSA-PSS-SHA2-512 protocol@TLS = TLS1.3 cipher@TLS = AES-256-GCM
$ sudo update-crypto-policies --set DEFAULT:CNSA2 $ sudo systemctl restart varnish

On RHEL 9, the policy tools do not know pure MLKEM1024 yet, so leave it out of the group@TLS line there. The @TLS scope keeps SSH and other protocols unchanged, but the policy applies to every application on the host that uses TLS.

On other distributions, give Varnish its own OpenSSL configuration file with a system_default section:

# /etc/varnish/openssl-cnsa.cnf openssl_conf = cnsa_init  [cnsa_init] ssl_conf = cnsa_ssl  [cnsa_ssl] system_default = cnsa_sys  [cnsa_sys] MinProtocol = TLSv1.3 Ciphersuites = TLS_AES_256_GCM_SHA384 Groups = SecP384r1MLKEM1024:MLKEM1024 SignatureAlgorithms = mldsa87:ECDSA+SHA384:ECDSA+SHA512:rsa_pss_rsae_sha384:rsa_pss_rsae_sha512:rsa_pss_pss_sha384:rsa_pss_pss_sha512

Point Varnish at it with a systemd drop-in, using sudo systemctl edit varnish:

[Service] Environment=OPENSSL_CONF=/etc/varnish/openssl-cnsa.cnf

This file replaces the distribution's OpenSSL configuration for Varnish only, which is why RHEL should use the crypto-policy instead: there, the distribution file carries the policy and FIPS settings.

With either approach, backend fetches only succeed against origins that support the profile, and an RSA certificate signs the handshake with SHA-384. Keep in mind that the profile covers every outgoing TLS connection Varnish makes, including VMODs that make HTTPS requests to other services. Those services must support ML-KEM-1024 too.

Summary

Post-quantum TLS in Varnish Enterprise is mostly a question of the platform it runs on. On OpenSSL 3.5, it works out of the box as long as your configuration does not remove the post-quantum groups. Check your OpenSSL version, check ecdh-curve, enable the PQ subpolicy on RHEL 9, and verify with openssl s_client. If you need CNSA 2.0, restrict Varnish to TLS 1.3, AES-256 and the ML-KEM-1024 groups, use a P-384 or ML-DSA-87 certificate, and apply the same profile to signature algorithms and backends through the system OpenSSL configuration.

If you have questions about your platform or upgrade path, reach out to your account team or contact support.