Quantum-secure HAProxy: frontend and backend groups

Set hybrid curves on the bind side with OpenSSL 3.5+, then test the frontend and the backend separately.

Quick answer: HAProxy can prefer X25519MLKEM768 when it links OpenSSL 3.5 or later. Set ssl-default-bind-curves for frontend listeners and ssl-default-server-curves for 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 / OpenSSLHybrid groupAction
HAProxy built with OpenSSL 3.5+AvailableSet the curve list
HAProxy with OpenSSL 3.0Not availableUpgrade the build
Per-bind curves setMay overrideInclude the hybrid group

Verify with Ready for Quantum

CheckWhat it answers
quantumDid this connection negotiate a PQ key exchange?
quantumcertDoes the certificate have the tested PQ property?
httpsIs trust and expiry acceptable?
OpenSSL via the Security expertWhich 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.

Next

Common questions

Which HAProxy directive sets frontend groups?

Use ssl-default-bind-curves in the global section for frontend listeners, with X25519MLKEM768 first. For backend TLS, use ssl-default-server-curves. Per-bind and per-server curves can override the defaults, so check the effective configuration.

Does HAProxy need OpenSSL 3.5?

Yes for the native ML-KEM hybrid groups. HAProxy passes the curve list to its linked OpenSSL library. A package built against an older OpenSSL will not add the capability even if the host has a newer shell binary.

How do I test frontend and backend separately?

Test the public frontend and the backend/origin as separate targets. A frontend can negotiate hybrid ML-KEM while the backend connection stays classical. Use an agent that can reach each side and record both results.

Keep exploring

Quantum-secure nginx: prove the origin negotiates hybrid TLS

Configure nginx against OpenSSL 3.5+, prefer X25519MLKEM768, and test the origin rather than only the CDN.

Quantum-secure Apache httpd: SSLOpenSSLConfCmd Groups

Set the hybrid group list on Apache, keep a classical fallback, and verify the negotiated group from a chosen agent.

Quantum-secure Envoy: downstream and upstream TLS

Envoy 1.40+ adds X25519MLKEM768 to the default ECDH curves, but downstream and upstream TLS are separate checks.

Browse the library · Quantum readiness docs · Check a system