Quick answer: HAProxy can prefer
X25519MLKEM768when it links OpenSSL 3.5 or later. Setssl-default-bind-curvesfor frontend listeners andssl-default-server-curvesfor backend TLS, then test both sides separately.
What this guide covers
It covers the TLS key exchange for HAProxy frontends and the optional backend TLS connection. It does not cover data at rest, code signing or QKD. A hybrid frontend does not make the backend connection post-quantum.
Check the build
haproxy -vv | grep -E "OpenSSL|SSL library"
ldd "$(command -v haproxy)" | grep -E 'ssl|crypto'
HAProxy passes the curve list to its linked OpenSSL. You need OpenSSL 3.5 or later for the native ML-KEM hybrid groups. A newer shell openssl does not upgrade HAProxy's linked library.
Configure the frontend
In the global section:
global
ssl-default-bind-options ssl-min-ver TLSv1.2
ssl-default-bind-curves X25519MLKEM768:X25519:P-256
Keep TLS 1.2 if you still have clients that need it. The hybrid group only applies to TLS 1.3.
Validate and reload:
haproxy -c -f /etc/haproxy/haproxy.cfg
systemctl reload haproxy
A per-bind curves option can override the global default. Check the effective listener configuration, not only the file you edited.
Configure the backend if it uses TLS
global
ssl-default-server-curves X25519MLKEM768:X25519:P-256
The backend connection is separate. A frontend can negotiate hybrid ML-KEM while HAProxy opens a classical connection to the application. Test the backend target if it is reachable.
Verify the negotiated group
From an OpenSSL 3.5+ client:
openssl s_client \
-connect example.com:443 \
-servername example.com \
-tls1_3 \
-groups X25519MLKEM768 \
</dev/null 2>/dev/null | grep -i "Negotiated TLS1.3 group"
Expected:
Negotiated TLS1.3 group: X25519MLKEM768
If the frontend falls back, check the HAProxy build, the global curve list and any per-bind override.
Version matrix
| HAProxy / OpenSSL | Hybrid group | Action |
|---|---|---|
| HAProxy built with OpenSSL 3.5+ | Available | Set the curve list |
| HAProxy with OpenSSL 3.0 | Not available | Upgrade the build |
Per-bind curves set | May override | Include the hybrid group |
Verify with Ready for Quantum
| Check | What it answers |
|---|---|
quantum | Did this connection negotiate a PQ key exchange? |
quantumcert | Does the certificate have the tested PQ property? |
https | Is trust and expiry acceptable? |
| OpenSSL via the Security expert | Which protocol, cipher and group were used? |
Use two agents when the public frontend and the backend are in different networks.
Failure example
A team sets ssl-default-bind-curves but a per-bind line still has curves X25519:P-256. The global default is ignored on that listener and the site stays classical. Removing the override or adding X25519MLKEM768 fixes the tested hop.
Automate it
- A Command Processor can collect the HAProxy version, linked OpenSSL, global curve settings and per-bind overrides.
- An AgentFlow can test the frontend and the backend and produce a two-hop report.
- A Connect can repeat the frontend check and alert on regression.
Limits
- One target, one port and one agent per check.
- The agent's algorithm set matters.
- Frontend and backend TLS are separate.
- No data-at-rest or QKD coverage.
- A clean frontend check does not prove the backend is configured correctly.