isquantumsafe Check a domain

isquantumsafe / Guides / HAProxy

Post-quantum TLS on HAProxy

Enable X25519MLKEM768 hybrid post-quantum key exchange (ML-KEM) on HAProxy with OpenSSL 3.5 or AWS-LC, using ssl-default-bind-curves, and verify the result.

Default
Partly on by default
You need
HAProxy linked against OpenSSL 3.5.0+ or AWS-LC (HAProxy Community 3.3+ or Enterprise 3.2+ packages)
Updated
4 December 2026 · 4 sources

HAProxy does not set a curve list unless you configure one, so it uses the default groups of the TLS library it was built with. Built against OpenSSL 3.5 or newer, it offers X25519MLKEM768 without changes. Built against an older OpenSSL, it cannot negotiate ML-KEM at all.

Requirements

  • A TLS library with ML-KEM hybrids: OpenSSL 3.5.0 or newer, or AWS-LC. HAProxy's glossary names both.
  • HAProxy's own guidance: HAProxy Enterprise 3.2+ and HAProxy Community 3.3+ support hybrid PQC natively in the packages HAProxy Technologies builds, because they ship with AWS-LC.
  • TLS 1.3 enabled on the bind line.
  • Check the library with haproxy -vv. Look at the "Built with" and "Running on" OpenSSL or AWS-LC lines.

Enable it

To set the order explicitly, add this to the global section of haproxy.cfg:

global
    ssl-default-bind-options ssl-min-ver TLSv1.2
    ssl-default-bind-curves X25519MLKEM768:X25519:P-256

This puts the hybrid group first and keeps X25519 and P-256 for older clients. HAProxy's blog example also adds SecP256r1MLKEM768 after the X25519 hybrid.

To set it for one frontend only, use the curves keyword on the bind line:

frontend https
    bind :443 ssl crt /etc/haproxy/certs/ curves X25519MLKEM768:X25519:P-256

For connections from HAProxy to your backends, ssl-default-server-curves in global (or curves on a server line) does the same job. Check the config with haproxy -c -f /etc/haproxy/haproxy.cfg, then reload.

Check it worked

From a machine with an OpenSSL 3.5 or newer client:

openssl s_client -connect example.com:443 -servername example.com \
  -groups X25519MLKEM768 -tls1_3 </dev/null 2>/dev/null | grep -i "group"

You should see Negotiated TLS1.3 group: X25519MLKEM768. HAProxy's blog also shows a test with the bssl tool shipped in its AWS-LC packages.

Run a free check at https://isquantumsafe.net/ to see the negotiated group and your grade.

Common problems

  • Distribution package on old OpenSSL. Many distribution HAProxy packages link the system OpenSSL. If that is 3.0 to 3.4, HAProxy rejects X25519MLKEM768 with "unable to set SSL curves list". Use a distribution with OpenSSL 3.5+ or HAProxy's AWS-LC packages.
  • A pinned classical list. An existing ssl-default-bind-curves X25519:P-256 replaces the library default and turns ML-KEM off.
  • TLS 1.2 only. HAProxy's blog notes that hybrid PQC needs TLS 1.3. Clients limited to TLS 1.2 never reach it.
  • Large ClientHello. Hybrid key shares push the first client message past one packet. Older middleboxes in front of HAProxy can drop it.

Sources

  1. How to enable post-quantum cryptography and TLS termination with HAProxy (HAProxy blog)
  2. What is post-quantum cryptography (HAProxy glossary)
  3. HAProxy configuration manual (curves, ssl-default-bind-curves)
  4. OpenSSL 3.5 Series Release Notes

Other guides: Web servers