On December 2, 2026, the NSA told owners and vendors of national security systems to immediately accelerate the transition to post-quantum cryptography. Traffic recorded today under classical key exchange can be decrypted later by whoever holds a large enough quantum computer, so the exposure is already open on every HTTPS and SSH port you run. Post-quantum TLS in nginx, Apache and HAProxy closes most of it with one directive, but the separator you type in that directive decides whether a downgrade stays silent.
We audited OpenSSL, enabled the hybrid X25519MLKEM768 group in all three servers and OpenSSH, and recorded what older clients get. Every capture comes from a December 2026 lab: Ubuntu 26.04 (OpenSSL 3.5.5, nginx 1.28.3, OpenSSH 10.2p1), Rocky Linux 10.2 (OpenSSL 3.5.9, nginx 1.26.3, OpenSSH 9.9p1) with SELinux enforcing, and an Ubuntu 24.04 box as the old client. ML-DSA certificates get a section too, mostly about why they are not ready.
What the NSA advisory changes for a Linux server
The press release and its companion advisory, “Immediate Actions to Push Toward Post-Quantum”, ask for prioritized CNSA 2.0 adoption and an inventory of where classical public-key cryptography still sits. They do not set a date for you. What they change is urgency, and on a Linux server the work splits into two problems that age very differently.
| Layer | What a future quantum attacker gets | Fix available now | Old clients |
|---|---|---|---|
| Key exchange (TLS groups, SSH kex) | Session keys for traffic recorded today | Hybrid X25519MLKEM768, mlkem768x25519-sha256 | Fall back to X25519 cleanly |
| Certificate signatures (ML-DSA) | Only live impersonation after the attack exists | ML-DSA-65 keys and certificates | Handshake failure, no fallback |
Key exchange is the urgent half because recorded traffic cannot be re-encrypted after the fact. Signatures only matter once someone can forge them in real time, and switching them today breaks clients, so the trade is lopsided. Our plan follows from that: hybrid key exchange everywhere, a classical certificate on every public listener, and ML-DSA served only alongside it.

Solid lines are the sessions a current client negotiated in our lab, and dotted lines show where legacy-lab01 landed. Nothing in the picture fails, and that is deliberate, because every listener keeps a classical tier behind the hybrid one. Getting there takes more care than the one-line configs in most guides suggest, so the sections follow the order we worked in: audit the library, fix the group list, prove the result, then OpenSSH and certificates.
The OpenSSL build behind every TLS listener
nginx, Apache, HAProxy and curl all inherit their groups from the system OpenSSL, so the library version sets the ceiling for everything later in this guide. ML-KEM and the hybrid groups arrived in the OpenSSL 3.5 line. Start with the version and the KEM list on each host.
openssl version
openssl list -kem-algorithms
Both lab servers list ML-KEM-512, 768 and 1024 plus four hybrids. For TLS the one that matters is X25519MLKEM768, which pairs classical X25519 with ML-KEM-768 so the session stays safe as long as either half holds. A flaw found in ML-KEM later would leave you with X25519 strength, not with nothing.

A KEM list proves the library can do the math, but it says nothing about the handshake. The TLS group list is what a server will actually accept on the wire, and every name you later put in ssl_ecdh_curve has to come from it, so read it on each terminator.
openssl list -tls1_3 -tls-groups
Ubuntu 26.04 printed the same TLS 1.3 groups as Rocky, ending in the ML-KEM and hybrid entries.
secp256r1:secp384r1:secp521r1:x25519:x448:brainpoolP256r1tls13:brainpoolP384r1tls13:brainpoolP512r1tls13:ffdhe2048:ffdhe3072:ffdhe4096:ffdhe6144:ffdhe8192:MLKEM512:MLKEM768:MLKEM1024:SecP256r1MLKEM768:X25519MLKEM768:SecP384r1MLKEM1024
Check the signature side as well, because the ML-DSA section later depends on it and a missing entry there would explain a failed certificate test before you spend time on the server config.
openssl list -signature-algorithms | grep -i -E "ml-dsa|slh-dsa"
ML-DSA-44, 65 and 87 appear on both distros, followed by the twelve SLH-DSA parameter sets. On a minimal Rocky image, confirm the openssl command exists before you start, and install it with sudo dnf install openssl if it does not, because the library alone gives you no way to run these checks.
Our old Ubuntu 24.04 host is the counterexample. Its OpenSSL 3.0 build returns zero ML-KEM entries, so nothing on that box can offer or accept a hybrid group whatever the web server config says. Count them to make the result unambiguous in a script.
openssl list -kem-algorithms 2>&1 | grep -ci mlkem
The count comes back as a bare zero.
0
For the general s_client and x509 flags used through the rest of this guide, the OpenSSL cheat sheet has them on one page. The December 1 OpenSSL security release also shipped 3.5.10, newer than both lab builds, so pick it up with your normal distro updates (its fixes are all rated Low); the latest OpenSSL security release notes list what it fixed.
Rocky Linux 10 crypto-policies already prefer the hybrid
Rocky does not leave group selection to each daemon. The system-wide crypto-policy writes an OpenSSL config that every TLS service loads, so read it before you add anything per server, or you may end up overriding a better default with a worse hand-written line.
update-crypto-policies --show
grep -i -E "groups|SignatureAlgorithms" /etc/crypto-policies/back-ends/opensslcnf.config
DEFAULT already uses the tiered syntax, with the hybrids alone in the first tier, a slash, then the classical curves. It also lists ML-DSA first in SignatureAlgorithms, each ML-DSA name prefixed with ? so the policy still loads on a build without them.

Keep an eye on that slash, because the next section is about what happens when it turns into a colon. The policy keeps the classical groups in a second tier, and one copied nginx line can undo it. Before moving on, each host in your audit should pass these checks.
openssl versionreports a 3.5 or newer library on every TLS terminator.openssl list -tls1_3 -tls-groupsincludesX25519MLKEM768.- On RHEL family hosts,
update-crypto-policies --showprints DEFAULT or a policy whose Groups line keeps the hybrids in their own tier.
Any host that fails the first check needs an OS upgrade, not a config change, because no directive can add groups the library lacks. Nothing below will work on it.
Post-quantum TLS in nginx and the colon trap
With ssl_ecdh_curve unset, nginx uses the library’s list (OpenSSL’s built-in default on Ubuntu, the crypto-policy Groups line on Rocky), and on both lab servers a stock client negotiated X25519MLKEM768 with no config change at all. On OpenSSL 3.5 the safe state is the default. Risk only comes in with the line people copy from a blog or a quickstart, so look at what that line actually does before you paste it.
Most guides show ssl_ecdh_curve X25519MLKEM768:X25519;. OpenSSL’s SSL_CTX_set1_groups_list documentation explains why that is weaker than it looks. A colon keeps groups in one tuple of “comparable security”, and within a tuple the server takes whichever group the client already sent a key share for. A slash starts a new tuple, and the server will send a HelloRetryRequest to get a key share from a higher tuple before it settles for a lower one.
A client that supports the hybrid but leads with an X25519 key share (an older library default, a tuned client, or a middlebox that strips the large share) exposes the difference. GitHub issue nginx/documentation#2522 reports that the colon form in NGINX’s own PQC quickstart allows exactly this silent fallback. We reproduced it on both distros.
Our lab servers had the packages from the distro repos: sudo apt install nginx apache2 haproxy curl on Ubuntu and sudo dnf install openssl nginx httpd mod_ssl haproxy curl policycoreutils-python-utils on Rocky. Every TLS listener below also needs a certificate, so we made a self-signed P-256 ECDSA one under /etc/pki/pq, a directory Ubuntu does not have by default. If you already hold a real certificate, from Let’s Encrypt for example, point the directives at it and skip this step.
sudo mkdir -p /etc/pki/pq
sudo openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -days 365 -subj "/CN=pq.example.com" -addext "subjectAltName=DNS:pq.example.com" -keyout /etc/pki/pq/ecdsa.key -out /etc/pki/pq/ecdsa.crt
With the key and certificate in place, create the nginx server block.
sudo vim /etc/nginx/conf.d/pq.conf
Our colon test ran with exactly this file. Its log_format line records the negotiated group per request, which the proof section uses later.
log_format pq '$remote_addr $ssl_protocol $ssl_curve $ssl_cipher "$request" $status';
server {
listen 443 ssl;
server_name pq.example.com;
ssl_certificate /etc/pki/pq/ecdsa.crt;
ssl_certificate_key /etc/pki/pq/ecdsa.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ecdh_curve X25519MLKEM768:X25519;
access_log /var/log/nginx/pq_access.log pq;
root /usr/share/nginx/html;
}
On Ubuntu, remove /etc/nginx/sites-enabled/default first so the stock site does not fight for the port. apt also starts Apache on port 80 at install, so stop it for now with sudo systemctl stop apache2 (httpd on Rocky) until its ports move in the next section. Then validate the config and start nginx, which dnf leaves stopped on Rocky.
sudo nginx -t && sudo systemctl enable --now nginx && sudo systemctl restart nginx
Point a client at the server that supports both groups but sends only an X25519 key share, and watch the handshake messages. A stock client would hide the problem, because it already sends the hybrid share.
openssl s_client -connect 127.0.0.1:443 -groups "*X25519:X25519MLKEM768" -msg </dev/null 2>/dev/null | grep -E "<<< .*(ServerHello|HelloRetryRequest)|>>> .*ClientHello"
An asterisk marks which group gets a key share. With the colon form there is one ClientHello, one ServerHello, and the session lands on classical X25519. No error, no warning, nothing in the error log. To see the fix, change the directive to X25519MLKEM768/X25519, run sudo nginx -t && sudo systemctl reload nginx, and repeat the same test.

In the bottom half, the same client talks to ssl_ecdh_curve X25519MLKEM768/X25519;. Now the server answers the first ClientHello with an 0x58 byte HelloRetryRequest (s_client labels it ServerHello), the client resends with a hybrid key share at 0x5c8 bytes, and the session ends on X25519MLKEM768. One extra round trip buys a guarantee that any client capable of the hybrid uses it, so we treat the slash as mandatory.
The tier that drops P-256 clients
Our first slash config had a trap of its own. X25519MLKEM768/X25519 names only two groups, so a client that offers nothing but P-256 has no overlap at all. On Ubuntu that client got a fatal alert instead of a classical session, which we only noticed because the test matrix included it.
openssl s_client -connect 127.0.0.1:443 -groups P-256 </dev/null 2>&1 | grep -iE 'error|alert' | head -1
Alert 40 is a handshake failure, and s_client reports the group as <NULL>.
40871216C47B0000:error:0A000410:SSL routines:ssl3_read_bytes:ssl/tls alert handshake failure:../ssl/record/rec_layer_s3.c:918:SSL alert number 40
Any client restricted to NIST curves lands in the same place, so add secp256r1 to the classical tier. We tested this final nginx line on Ubuntu with all three client types. OpenSSL’s own built-in default goes further and keeps lower tiers with X448, secp384r1, secp521r1 and two ffdhe groups, so if P-384-only clients (CNSA 1.0 era systems) reach you, append /secp384r1:secp521r1 or leave the directive unset.
ssl_ecdh_curve X25519MLKEM768/X25519:secp256r1;
Validate and reload. On a production box, nginx -t is the only safe gate before a restart, because a group name the library rejects stops the whole server, not one vhost.
sudo nginx -t && sudo systemctl reload nginx
With that line, the P-256 client now gets Peer Temp Key: ECDH, prime256v1, 256 bits, while the X25519-first client and a stock client both still get X25519MLKEM768. In the matrix below, the first three rows match on both lab servers and the last row ran on Ubuntu.
| ssl_ecdh_curve | Stock client | X25519 share first | X25519 only | P-256 only |
|---|---|---|---|---|
| unset (library default) | X25519MLKEM768 | X25519MLKEM768 after HRR | skipped | skipped |
| X25519MLKEM768:X25519 | X25519MLKEM768 | X25519, silent | X25519 | skipped |
| X25519MLKEM768/X25519 | X25519MLKEM768 | X25519MLKEM768 after HRR | X25519 | handshake failure |
| X25519MLKEM768/X25519:secp256r1 | X25519MLKEM768 | X25519MLKEM768 after HRR | skipped | prime256v1 |
TLS 1.2 kept working with the slash form, because ML-KEM groups only exist in TLS 1.3 and OpenSSL simply skips them for a 1.2 handshake. A post-quantum-only line, ssl_ecdh_curve X25519MLKEM768;, is the one choice we would never ship on a public listener. A client offering X25519 and P-256 got the same alert 40 shown above, so every browser and library without ML-KEM would be locked out.
Apache and HAProxy group lists
Apache and HAProxy hand the same string to OpenSSL’s group-list parser, so the colon and slash behaviour carries over; we confirmed the colon fallback on HAProxy and the slash result on both. In the lab both ran next to nginx on the same host, which is why they listen on 8443 and 9443, while in production each would own 443. On Ubuntu, enable the module and create the vhost.
sudo a2enmod ssl
sudo vim /etc/apache2/sites-available/pq-ssl.conf
On Rocky the same content goes in /etc/httpd/conf.d/pq-ssl.conf, with mod_ssl installed. SSLOpenSSLConfCmd Groups takes the OpenSSL syntax verbatim, slash included. Our Apache and HAProxy tests ran the two-group list, which drops P-256-only clients exactly as it did in nginx, so append :secp256r1 before you copy either block to production.
<VirtualHost *:8443>
ServerName pq.example.com
SSLEngine on
SSLCertificateFile /etc/pki/pq/ecdsa.crt
SSLCertificateKeyFile /etc/pki/pq/ecdsa.key
SSLProtocol -all +TLSv1.2 +TLSv1.3
SSLOpenSSLConfCmd Groups X25519MLKEM768/X25519
DocumentRoot /var/www/html
</VirtualHost>
Enable the site on Ubuntu with sudo a2ensite pq-ssl, then test the syntax. Because Apache shared the host with nginx, we also moved its Listen 443 lines to 8443 (in /etc/apache2/ports.conf on Ubuntu, /etc/httpd/conf.d/ssl.conf on Rocky) and its Listen 80 line to 8080 (ports.conf on Ubuntu, /etc/httpd/conf/httpd.conf on Rocky), otherwise both ports collide with nginx. The stock vhosts followed (*:80 to *:8080 in Ubuntu’s 000-default.conf, _default_:443 to _default_:8444 in Rocky’s ssl.conf). Use apache2ctl on Ubuntu and apachectl on Rocky.
sudo apache2ctl configtest
Both distros returned the plain confirmation.
Syntax OK
Restart Apache so it loads the module, the new ports and the vhost. Swap in httpd on Rocky; a restart also starts a unit that was stopped, and systemctl is-active printed active on both hosts afterwards.
sudo systemctl restart apache2
From Apache, the X25519-first client got X25519MLKEM768 and a classical-only client got X25519, 253 bits, the same split as nginx. Add :secp256r1 to the second tier here too if P-256-only clients reach this vhost, since Apache has no fallback of its own beyond the list you give it.
HAProxy takes the list globally with ssl-default-bind-curves or per listener with curves on the bind line. The simplest form is the certificate and key in one PEM, readable only by root, so build that file and back up the stock haproxy.cfg before editing, since the test config below replaces it whole.
sudo sh -c 'cat /etc/pki/pq/ecdsa.crt /etc/pki/pq/ecdsa.key > /etc/haproxy/pq.pem; chmod 600 /etc/haproxy/pq.pem'
sudo vim /etc/haproxy/haproxy.cfg
Below is the complete lab config. Its frontend answers every request with a fixed 200 so the TLS layer can be tested without a backend, and it leaves out the stock user, group and chroot lines, so keep those from your backup on a real host.
global
log /dev/log local0
ssl-default-bind-curves X25519MLKEM768/X25519
ssl-default-bind-options ssl-min-ver TLSv1.2
defaults
mode http
timeout connect 5s
timeout client 30s
timeout server 30s
frontend fe_pq
bind :9443 ssl crt /etc/haproxy/pq.pem
http-request return status 200 content-type text/plain string ok
On Rocky, SELinux blocks HAProxy from binding a non-standard port until you allow it. One boolean was the only SELinux change our HAProxy test needed, and enforcing mode stayed on.
sudo setsebool -P haproxy_connect_any 1
A passing haproxy -c prints nothing, so check the exit code explicitly instead of trusting silence.
sudo haproxy -c -f /etc/haproxy/haproxy.cfg; echo exit=$?
Both builds passed.
exit=0
Enable and restart HAProxy next. On Ubuntu the package is already running the stock config, so only a restart loads the 9443 frontend, and on Rocky the unit is not running until you start it.
sudo systemctl enable haproxy && sudo systemctl restart haproxy
We then swapped the slash for a colon in ssl-default-bind-curves and repeated the X25519-first test. HAProxy behaved exactly like nginx, with Peer Temp Key: X25519, 253 bits for the colon and X25519MLKEM768 for the slash. If you terminate TLS on a load balancer, fix that config first, because the web servers behind it never see the client’s handshake and their own perfect group lists change nothing for visitors.
On Rocky, open the listener ports in firewalld before testing from another machine. Each command printed success.
sudo firewall-cmd --permanent --add-service=https && sudo firewall-cmd --permanent --add-port={8443,8445-8447,9443}/tcp && sudo firewall-cmd --reload
Ports 8445 and 8446 belong to the ML-DSA servers below. Port 8447 ran a copy of the server block with ssl_ecdh_curve X25519MLKEM768; alone and TLS 1.3 only, so the old host could test a post-quantum-only listener over the network; it answered with the same alert 40. That listener is optional: skip 8447 in the firewall command unless you build it, and if you do, label it with semanage like the other two. On a production host you would open 443 and nothing else.
Proof of the negotiated group
A config that passes nginx -t proves nothing about what clients negotiate, so check from the client side first. OpenSSL 3.5’s s_client prints the hybrid on its own line, which makes it easy to grep.
openssl s_client -connect 127.0.0.1:443 -servername pq.example.com </dev/null 2>/dev/null | grep -E "^(Protocol|Negotiated TLS1.3 group)"
A hybrid session reports the group by name.
Negotiated TLS1.3 group: X25519MLKEM768
Protocol: TLSv1.3
Watch for one quirk while scripting this. A classical session does not print a Negotiated TLS1.3 group line at all, so a grep for the hybrid line alone returns nothing on a downgrade, and a careless script reads that as success. Each tool in the lab reported the two outcomes differently.
- OpenSSL 3.5 s_client prints
Negotiated TLS1.3 group: X25519MLKEM768for a hybrid session andPeer Temp Key: X25519, 253 bitsfor a classical one. - OpenSSL 3.0 s_client prints
Server Temp Keyfor the classical group and never names a hybrid. - curl puts the group in the third field of its
SSL connection usingline. - nginx
$ssl_curvelogs the name on Ubuntu and the codepoint0x11econ Rocky.
curl is the handy check from a workstation. The curl cheat sheet covers the --resolve trick used here to test a hostname before DNS points at the box.
curl -sv -k --resolve pq.example.com:443:127.0.0.1 https://pq.example.com/ -o /dev/null 2>&1 | grep -E "SSL connection|TLS handshake, Server hello"
Read the connection line field by field. After the protocol and cipher comes the key exchange group, and the last field is the certificate key type.
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519MLKEM768 / id-ecPublicKey
Client tests show one connection. An access log shows every real client, and that is how you find out what share of traffic is still classical after the change. With the pq log format from the server block, Ubuntu’s nginx writes the group by name.
sudo tail -n 3 /var/log/nginx/pq_access.log
In the output, the middle line is our classical-only test client.
127.0.0.1 TLSv1.3 X25519MLKEM768 TLS_AES_256_GCM_SHA384 "GET / HTTP/1.1" 200
127.0.0.1 TLSv1.3 X25519 TLS_AES_256_GCM_SHA384 "GET / HTTP/1.1" 200
127.0.0.1 TLSv1.3 X25519MLKEM768 TLS_AES_256_GCM_SHA384 "GET / HTTP/1.1" 200
Rocky’s nginx logged the same sessions differently. Its $ssl_curve prints the hybrid as the raw codepoint 0x11ec, the IANA value for X25519MLKEM768, while classical groups still appear by name. The cause is the nginx version rather than the distro, because nginx 1.27.5 fixed $ssl_curve for groups OpenSSL adds through providers, and Rocky 10 ships 1.26.3.

If your log pipeline or SIEM rule matches the string X25519MLKEM768, it will count zero hybrid sessions on Rocky and report the rollout as failed. Match both forms, for example grep -cE 'X25519MLKEM768|0x11ec', and alert on the classical share instead, because a rising classical share is the signal that something upstream broke.
Hybrid key exchange in OpenSSH
SSH sessions carry the same harvest risk as HTTPS, and here both distros are already ahead of the web servers. Check what the client build knows and what the server offers before you change anything.
ssh -Q kex | grep -E "mlkem|sntrup"
sudo sshd -T | grep -i ^kexalgorithms
Ubuntu 26.04 offers mlkem768x25519-sha256 first, then two spellings of sntrup761x25519-sha512, then the classical curves.
sntrup761x25519-sha512
[email protected]
mlkem768x25519-sha256
kexalgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,[email protected],curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
Rocky’s crypto-policy puts three ML-KEM hybrids first but has no sntrup entry at all. That gap matters for older clients such as OpenSSH 9.6, covered below, since sntrup is the only post-quantum method they speak.
kexalgorithms mlkem768x25519-sha256,mlkem768nistp256-sha256,mlkem1024nistp384-sha384,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512
To set one list on both distros, use a drop-in that sorts before Rocky’s 50-redhat.conf. sshd keeps the first value it reads for each keyword, so a 40- file wins, and you avoid editing the policy-managed file that an update could overwrite.
sudo vim /etc/ssh/sshd_config.d/40-pq-kex.conf
Our list keeps ML-KEM first, sntrup as the post-quantum option for older OpenSSH clients, and curve25519-sha256 as the classical fallback. Clients that only speak NIST ECDH need ecdh-sha2-nistp256 added back at the end, DH-only clients need diffie-hellman-group14-sha256, and RHEL hosts in FIPS mode should stay on the crypto-policy instead of this override.
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,[email protected],curve25519-sha256
Test before you restart. A broken sshd config on a remote box is a lockout, so keep your current session open until a second login succeeds, and only then close it.
sudo sshd -t && echo config OK; sudo sshd -T | grep -i ^kexalgorithms
Both servers returned the drop-in’s list, Rocky included, which proves it overrode the policy file.
config OK
kexalgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,[email protected],curve25519-sha256
Restart with sudo systemctl restart ssh on Ubuntu or sudo systemctl restart sshd on Rocky. A verbose login then names the method, and ours logged debug1: kex: algorithm: mlkem768x25519-sha256 on both servers. The post-quantum SSH hardening guide covers host keys and ciphers on Ubuntu, and the SSH server setup on Rocky Linux 10 covers the rest of that side.
An old OpenSSH 9.6 client on Ubuntu 24.04 shows why sntrup stays in the list. Against the drop-in it negotiated [email protected], still post-quantum. Against Rocky with an ML-KEM-only list, it was refused outright.

Do not ship an ML-KEM-only list to servers that automation, backup agents or older jump hosts reach. Those clients fail exactly like this, and on a box with no console access that is an outage you cannot fix over SSH. The reverse direction is safe, so new clients need no special care: the OpenSSH 10.2 client connecting to the old 24.04 server picked sntrup without any configuration.
ML-DSA certificates and the clients that reject them
Hybrid key exchange protects recorded traffic. ML-DSA certificates protect authentication instead, and switching to them breaks every client whose library predates them, so we kept this part of the lab separate. OpenSSL 3.5 can already generate the key and a self-signed certificate.
sudo openssl genpkey -algorithm ML-DSA-65 -out /etc/pki/pq/mldsa65.key
sudo openssl req -x509 -key /etc/pki/pq/mldsa65.key -days 365 -subj "/CN=pq.example.com" -addext "subjectAltName=DNS:pq.example.com" -out /etc/pki/pq/mldsa65.crt
Confirm the algorithm and compare the size against the ECDSA certificate the earlier servers used.
openssl x509 -in /etc/pki/pq/mldsa65.crt -noout -text | grep -E "Signature Algorithm|Public Key Algorithm" | sort -u
ls -l /etc/pki/pq/ecdsa.crt /etc/pki/pq/mldsa65.crt
Our ML-DSA certificate came out twelve times larger, and that is before a chain of intermediates signed the same way.
Public Key Algorithm: ML-DSA-65
Signature Algorithm: ML-DSA-65
Signature Algorithm: ML-DSA-65
-rw-r--r-- 1 root root 627 Dec 2 19:44 /etc/pki/pq/ecdsa.crt
-rw-r--r-- 1 root root 7566 Dec 2 19:44 /etc/pki/pq/mldsa65.crt
nginx accepts more than one ssl_certificate pair and picks one per client from the signature algorithms that client offers. We ran two servers side by side, 8445 with ML-DSA and ECDSA together and 8446 with ML-DSA alone, so one test could show both outcomes. Create the file for both servers.
sudo vim /etc/nginx/conf.d/mldsa.conf
Both blocks use the two-group slash list from earlier and TLS 1.3 only. That is a lab list, so append :secp256r1 on any listener real clients reach.
server {
listen 8445 ssl;
server_name pq.example.com;
ssl_certificate /etc/pki/pq/mldsa65.crt;
ssl_certificate_key /etc/pki/pq/mldsa65.key;
ssl_certificate /etc/pki/pq/ecdsa.crt;
ssl_certificate_key /etc/pki/pq/ecdsa.key;
ssl_protocols TLSv1.3;
ssl_ecdh_curve X25519MLKEM768/X25519;
root /usr/share/nginx/html;
}
server {
listen 8446 ssl;
server_name pq.example.com;
ssl_certificate /etc/pki/pq/mldsa65.crt;
ssl_certificate_key /etc/pki/pq/mldsa65.key;
ssl_protocols TLSv1.3;
ssl_ecdh_curve X25519MLKEM768/X25519;
root /usr/share/nginx/html;
}
On Rocky, label the two new ports for nginx before reloading, because SELinux only lets nginx bind the labelled HTTP ports. Without the label, nginx logs a permission denied bind error and the new servers never come up.
for p in 8445 8446; do sudo semanage port -a -t http_port_t -p tcp $p; done
Then test and reload on both distros. nginx -t printed the usual “syntax is ok” and “test is successful” pair on both hosts.
sudo nginx -t && sudo systemctl reload nginx
A current client trusts the ML-DSA certificate once you hand it the self-signed file as its CA. Point curl at the ML-DSA-only server on 8446.
curl -sv --cacert /etc/pki/pq/mldsa65.crt --resolve pq.example.com:8446:127.0.0.1 https://pq.example.com:8446/ -o /dev/null 2>&1 | grep -E 'SSL connection|certificate verify|SSL certificate|HTTP/'
curl on both distros verified the certificate and completed the handshake over X25519MLKEM768, and the handshake size in the lower half shows what ML-DSA costs on the wire.

Our client read 1,883 bytes from the ECDSA server and 10,248 bytes from the ML-DSA one, on a single self-signed certificate. On the dual server, a current s_client received Peer signature type: mldsa65, and the same client restricted to -sigalgs ECDSA+SHA256:RSA-PSS+SHA256 received ecdsa_secp256r1_sha256. Selection works as documented, so the dual setup is the safe way to experiment. This is the restricted test against 8445.
openssl s_client -connect 127.0.0.1:8445 -sigalgs ECDSA+SHA256:RSA-PSS+SHA256 -servername pq.example.com </dev/null 2>/dev/null | grep -E 'Peer signature type|Negotiated TLS1.3 group'
It keeps the hybrid key exchange and only swaps the certificate.
Peer signature type: ecdsa_secp256r1_sha256
Negotiated TLS1.3 group: X25519MLKEM768
Now the old OpenSSL 3.0 host. Against ML-DSA alone, both s_client and curl hit a hard handshake failure. Against the dual server, they quietly got ECDSA and X25519.

Key exchange is ready and certificates are not, and this screenshot is why. A hybrid group degrades to classical for an old client, whereas an ML-DSA-only certificate refuses it outright, and the error gives the user no hint about the cause. We used self-signed certificates, so before you plan anything public, ask your CA whether it issues ML-DSA at all. For an internal experiment, serve ML-DSA only as a second certificate next to ECDSA, never alone.
Errors from old clients and old OpenSSL builds
Every failure below came out of the lab, with the cause behind each. All of them trace back to either an old library at one end or a group list with no fallback, so the remedies repeat.
SSL_CTX_set1_curves_list failed: group ‘X25519MLKEM768’ cannot be set
Config management produces this one when a template written for a new host lands on an old one. nginx on Ubuntu 24.04 with OpenSSL 3.0 refuses to start.

Slash and colon forms fail the same way, and so does the ?X25519MLKEM768/X25519 form that OpenSSL documents for “ignore if not implemented”. OpenSSL 3.0 reads the whole string as one unknown group name and reports group '?X25519MLKEM768/X25519' cannot be set. On OpenSSL 3.5 that line passes nginx -t, but it does not rescue an old host. Template the directive per OS version, or leave ssl_ecdh_curve out on hosts still on 3.0.
ssl/tls alert handshake failure: SSL alert number 40
Server and client share no group, or no signature algorithm. We saw it in three places: a P-256-only client against X25519MLKEM768/X25519, any classical client against ssl_ecdh_curve X25519MLKEM768 alone, and OpenSSL 3.0 against the ML-DSA-only certificate. Old clients phrase it as sslv3 alert handshake failure, and curl 8.5 shows TLS alert, handshake failure (552). Every case went away once a classical fallback was back in place, meaning X25519:secp256r1 in the second tier and an ECDSA certificate beside any ML-DSA one.
Unable to negotiate: no matching key exchange method found
Here the SSH server’s KexAlgorithms holds only methods the client lacks. Read the message closely, because it lists the server’s offer, which tells you exactly what to add back. Keep [email protected] for OpenSSH 9.x clients and curve25519-sha256 for everything older.
Timeouts behind firewalls after enabling the hybrid
We did not hit this in the lab, but OpenSSL’s documentation names it. A hybrid key share pushes the ClientHello past one TCP segment (the retried ClientHello above carried 0x5c8, or 1,480, bytes of handshake data), and some firewalls mishandle the split. OpenSSL documents a client-side workaround, prepending ?X25519MLKEM768: without a * to the DEFAULT pseudo-group (a client groups string of ?X25519MLKEM768:DEFAULT), which stops the client predicting the hybrid share and lets servers that want it ask via HRR. If one network path times out while others work, capture the handshake there before blaming the server config.
Rollout audit checklist
Run these in order on each host. Every item is a condition you can check with a command from this guide, and a host is not done until all of them hold.
- Every TLS terminator, load balancers included, links against OpenSSL 3.5 or newer and lists
X25519MLKEM768inopenssl list -tls1_3 -tls-groups. - No nginx, Apache or HAProxy config puts the hybrid and a classical group in the same colon tier; the line reads
X25519MLKEM768/X25519:secp256r1or is left at the OpenSSL default. - A client sending an X25519 key share first ends on
X25519MLKEM768, checked withopenssl s_client -groups "*X25519:X25519MLKEM768". - Classical X25519 and P-256-only clients still complete a handshake, and so do P-384-only clients if you serve any.
- The access log records
$ssl_curve, and log queries match bothX25519MLKEM768and0x11ec. sshd -Tlistsmlkem768x25519-sha256first and still includes sntrup andcurve25519-sha256.- A verbose SSH login from a current client logs
kex: algorithm: mlkem768x25519-sha256, and one from your oldest automation host still connects. - No public listener serves an ML-DSA certificate without an ECDSA or RSA certificate beside it.
- Configuration management templates
ssl_ecdh_curveper OS, so no OpenSSL 3.0 host receives a hybrid group name.
Items two and three are the ones a casual rollout misses, because a colon config passes every syntax check and a stock client test. Run the X25519-first test on every listener you own, load balancers first, and only then report the host as post-quantum ready.