Emergency server help: get in touch

Enable Post-Quantum TLS on AlmaLinux 9 with DirectAdmin (Tested)

AlmaLinux 9 ships OpenSSL 3.5 with hybrid post-quantum key exchange, but the default crypto policy leaves it out. One policy change turns it on for Apache, Exim, Dovecot and FTP. Tested on DirectAdmin 1.712.

Published Updated 9 min read

Short answer: On AlmaLinux 9 the web, mail and FTP servers that DirectAdmin installs use the system OpenSSL 3.5, which supports the hybrid post-quantum key exchange X25519MLKEM768, but the default crypto policy leaves it out. Run update-crypto-policies --set DEFAULT:PQ and restart the services. On our DirectAdmin test server Apache, Exim, Dovecot and Pure-FTPd then negotiated X25519MLKEM768 with modern clients, older clients still got X25519, and the setting survived CustomBuild rebuilds. (Reviewed October 2026.)

Post-quantum TLS protects today’s traffic against “harvest now, decrypt later”: someone records encrypted sessions now and decrypts them once large quantum computers exist. The hybrid group X25519MLKEM768 combines the classic X25519 key exchange with ML-KEM-768 (FIPS 203), so a session stays safe as long as either part holds. Chrome and Edge 131+, Firefox 132+ on desktop and Safari 26+ already offer it in every TLS 1.3 handshake, according to Cloudflare’s client support list. The server decides whether it is used, and a stock AlmaLinux 9 server says no.

Check whether your server uses post-quantum TLS

You need a client that can offer the hybrid group: OpenSSL 3.5 or newer. AlmaLinux 9.8 ships OpenSSL 3.5.8, so you can test from the server itself or from any other AlmaLinux 9.8 machine. Offer the post-quantum group first and X25519 as a fallback, and see which one the server picks:

echo | openssl s_client -connect server.example.com:443 -servername server.example.com \
  -groups X25519MLKEM768:X25519 2>&1 | grep -E "Negotiated TLS1.3 group|Peer Temp Key"

Negotiated TLS1.3 group: X25519MLKEM768 means post-quantum key exchange is on. Peer Temp Key: X25519 means the server chose the classic group. For mail and FTP, test the TLS ports (465 and 993) the same way, and the STARTTLS ports with -starttls smtp (port 587) or -starttls ftp (port 21). You can also check the encryption of any HTTPS site with our TLS version checker.

On our DirectAdmin 1.712 test server with the default policy, every service we checked chose X25519:

PortServiceDefault policy (DEFAULT)After DEFAULT:PQ
443Apache 2.4.69 (HTTPS)X25519X25519MLKEM768
465 / 587Exim 4.100.1 (SMTPS / submission with STARTTLS)X25519X25519MLKEM768
993Dovecot 2.4.5 (IMAPS)X25519X25519MLKEM768
21Pure-FTPd (explicit FTPS)X25519X25519MLKEM768 after a restart of pure-ftpd
2222DirectAdmin panelX25519MLKEM768X25519MLKEM768 (unchanged)

The DirectAdmin panel already negotiated the hybrid group before any change, because it does not use the system OpenSSL settings. Everything else links to /lib64/libssl.so.3 and follows the system-wide crypto policy.

Why AlmaLinux 9 leaves it out

AlmaLinux, like RHEL, sets TLS defaults for every program through crypto-policies. On AlmaLinux 9.8 the DEFAULT policy lists only classic groups:

grep ^Groups /etc/crypto-policies/back-ends/opensslcnf.config
Groups = *X25519:secp256r1:X448:secp521r1:secp384r1:ffdhe2048:ffdhe3072:ffdhe4096:ffdhe6144:ffdhe8192

The ML-KEM groups are shipped as an optional policy module, /usr/share/crypto-policies/policies/modules/PQ.pmod (crypto-policies 20260224 on our server). It adds the hybrid groups MLKEM768-X25519, P256-MLKEM768, P384-MLKEM1024 and MLKEM1024-X448, plus ML-DSA signature algorithms. Adding the module does not remove anything, so clients that only know X25519 keep working.

Turn on post-quantum TLS: one policy change

( set -eu
  R=/root/crypto-policy.before
  CUR=$(update-crypto-policies --show)
  case ":$CUR:" in *:PQ:*) echo "Post-quantum is already on ($CUR). Nothing changed."; exit 0 ;; esac
  if [ -e "$R" ]; then echo "$R already exists. It may hold your original policy: check it, then move it away." >&2; exit 1; fi
  printf '%s\n' "$CUR" > "$R"; chmod 600 "$R"
  update-crypto-policies --set "$CUR:PQ"
  echo "Original policy saved in $R"
  systemctl restart httpd exim dovecot pure-ftpd
)
  • The command prints “It is recommended to restart the system for the change of policies to fully take place”. Programs read the policy when they start, so every TLS service needs a restart. On our server Pure-FTPd kept offering only X25519 until we restarted it. A reboot covers everything at once, including PHP-FPM, whose outbound connections (curl, SMTP from PHP) use the same library.
  • If your server uses OpenLiteSpeed or LiteSpeed instead of Apache, see below: the policy does not reach them.
  • The block adds the module to whatever policy you had, so a custom policy such as DEFAULT:SHA1 becomes DEFAULT:SHA1:PQ, and saves the original in /root/crypto-policy.before. It changes nothing if post-quantum is already on, and it refuses to overwrite an existing record, so running it twice cannot lose your original policy. We tested only DEFAULT; if the server runs the FIPS policy, check Red Hat’s guidance for FIPS mode first, because we did not test it.

For mail, post-quantum TLS protects each connection that uses TLS; to make other mail servers insist on TLS when they deliver to you, also set up MTA-STS.

Then run the check from the first section again. On our server, for each port:

  • A client offering X25519MLKEM768 and X25519 got X25519MLKEM768 on 443, 465, 587, 993 and 21.
  • A client offering only X25519 still got X25519, so older browsers and mail servers are not affected.
  • A TLS 1.2 client (curl with --tls-max 1.2) still loaded the site (HTTP 200). Post-quantum key exchange is TLS 1.3 only.
  • The server’s own outbound connections now offer the hybrid group too: openssl s_client from the server to www.google.com and www.cloudflare.com negotiated X25519MLKEM768 without any -groups option.

What it costs: handshake size and speed

The ML-KEM key share is large. We captured the handshake with openssl s_client -msg:

Handshake messageX25519X25519MLKEM768
ClientHello315 bytes1,491 bytes
ServerHello122 bytes1,210 bytes

About 2.3 KB more per new TLS 1.3 connection, which is small next to a web page. Speed was not measurably different on our single-core test server: 40 handshakes in a row took 35 ms each with X25519 and 33 ms each with X25519MLKEM768, including starting the openssl process every time. The bigger ClientHello is a client-side change that browsers already made; Apple notes that some old TLS implementations fail on large ClientHello messages. Your server is not one of them if the check above succeeds.

Does it survive DirectAdmin and CustomBuild updates?

Yes. Post-quantum TLS stays on because the setting lives in the operating system, not in DirectAdmin’s templates, so CustomBuild has nothing to overwrite. We checked three rebuilds after the change:

  • da build rewrite_confs (rewrites all web server configs): port 443 still negotiated X25519MLKEM768.
  • da build dovecot (compiled Dovecot 2.4.5 from source again, 10 minutes on one core) and da build exim: ports 465 and 993 still negotiated X25519MLKEM768.
  • DirectAdmin’s Apache config sets cipher suites for TLS 1.2 only (SSLCipherSuite) and no group list, so it does not override the policy. If you added your own SSLOpenSSLConfCmd Groups, tls_eccurve (Exim) or ssl_curve_list (Dovecot) line, that line wins over the policy: remove it or add X25519MLKEM768 to it.

OpenLiteSpeed, LiteSpeed and AlmaLinux 8

  • OpenLiteSpeed does not use the system OpenSSL. It ships its own TLS library (BoringSSL) inside the binary, so the crypto policy has no effect on it. On our production server, OpenLiteSpeed 1.9.3 (built 30 Sep 2026, the newest 1.9.x release) offered only X25519: a client offering only X25519MLKEM768 or SecP256r1MLKEM768 got a handshake failure. The bundled library contains code for the older pre-standard Kyber draft, not ML-KEM, and the 1.9.x release log does not mention post-quantum support. Watch for a release that updates BoringSSL.
  • LiteSpeed Enterprise and nginx built by CustomBuild were not tested.
  • AlmaLinux 8 cannot do it. Its system OpenSSL is 1.1.1k, which has no ML-KEM, so Apache, Exim and Dovecot there stay on classic groups whatever the policy says. The only routes on AlmaLinux 8 are a proxy in front (Cloudflare’s proxy offers the hybrid group to visitors) or moving to AlmaLinux 9 or 10.
  • AlmaLinux 10 already does it by default. In the AlmaLinux 10.2 image, the DEFAULT policy lists MLKEM768-X25519 first, and there is a NO-PQ module to turn it off instead. We read the policy files; we did not run DirectAdmin on AlmaLinux 10 for this guide.

Undo it

( set -eu
  R=/root/crypto-policy.before
  update-crypto-policies --set "$(cat "$R")"
  mv "$R" "$R.restored-$(date +%Y%m%d%H%M%S)"   # keep it, out of the way
  systemctl restart httpd exim dovecot pure-ftpd
)

This puts back exactly the policy you saved, including any other modules it had, and the server offers X25519 again. If you did not save the policy, run update-crypto-policies --show and remove only the :PQ part. We tested both blocks on our AlmaLinux 9.8 server on 19 October 2026: DEFAULT:SHA1 became DEFAULT:SHA1:PQ, a second run changed nothing and kept the saved record, undo restored DEFAULT:SHA1, and a leftover record stopped the apply block before any change.

How we tested

  • Test server: AlmaLinux 9.8 (kernel 5.14.0-687) on a 1-vCPU KVM VPS with 4 GB RAM, DirectAdmin 1.712, Apache 2.4.69, Exim 4.100.1, Dovecot 2.4.5, Pure-FTPd, OpenSSL 3.5.8, crypto-policies 20260224, 19 October 2026.
  • Client: openssl s_client 3.5.8 with -groups, against each port before and after the change, plus a client offering only X25519 and a TLS 1.2 client.
  • Rebuilds after the change: da build rewrite_confs, da build dovecot, da build exim.
  • OpenLiteSpeed: our production server (AlmaLinux 8.10, OpenLiteSpeed 1.9.3); read-only checks only.
  • Not tested: LiteSpeed Enterprise, nginx, DirectAdmin on AlmaLinux 10, outbound SMTP to other mail servers on port 25 (blocked on the test VPS).

FAQ

Do browsers already use post-quantum key exchange?

Yes. Chrome, Edge and other Chromium browsers from version 131, Firefox 132+ on desktop and Safari 26+ include X25519MLKEM768 in every TLS 1.3 handshake. Whether it is used depends only on the server.

Does this replace my certificate?

No. Certificates still use RSA or ECDSA signatures; only the key exchange changes. Your Let’s Encrypt certificates and their renewal keep working as they are.

Can it break old clients?

Not in our test: a client that only knew X25519 got X25519, and a TLS 1.2 client connected normally. The server only uses the hybrid group when the client offers it.

Is it safe to use a hybrid group now?

The hybrid group is designed so that the connection is at least as strong as X25519 alone, even if a weakness is found in ML-KEM. It is the default in current browsers, OpenSSL 3.5 and Go 1.24.

At a glance

Enable Post-Quantum TLS on AlmaLinux 9 with DirectAdmin (Tested) summary card: On AlmaLinux 9 the web, mail and FTP servers that DirectAdmin installs use the system OpenSSL 3.5, which supports the hy…
In short: On AlmaLinux 9 the web, mail and FTP servers that DirectAdmin installs use the system OpenSSL 3.5, which supports the hybrid post-quantum key exchange X25519MLKEM768, but the default crypto…

Share this guide

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.