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.

Quick answer: nginx can negotiate hybrid ML-KEM when it is built against OpenSSL 3.5+ and the group list includes X25519MLKEM768. Test the origin, not only the CDN hostname.

nginx can negotiate a hybrid post-quantum key exchange when it is built against OpenSSL 3.5 or later and the TLS 1.3 group list includes X25519MLKEM768. The important part is testing the origin, because a CDN can protect the browser-to-edge hop while the edge-to-origin hop stays classical.

What this guide covers

It covers the TLS key exchange for an nginx server and, where relevant, the origin behind a CDN. It does not cover data at rest, code signing or QKD. A hybrid session does not make the certificate post-quantum.

Check what nginx is linked against

nginx -V 2>&1 | tr ' ' '\n' | grep -E 'openssl|ssl'
ldd "$(command -v nginx)" | grep -E 'ssl|crypto'
openssl version -a

If nginx links OpenSSL older than 3.5, the group name will not be available. Upgrade the library and the nginx package, or terminate TLS on a proxy that has 3.5+.

Configure the group

A tested pattern for nginx on OpenSSL 3.5+:

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1;

ssl_ecdh_curve is the nginx directive that passes the group list to OpenSSL. On builds that expose OpenSSL's configuration command, this is equivalent:

ssl_conf_command Groups X25519MLKEM768:X25519:prime256v1;

Keep a classical fallback. A client that does not support the hybrid group should still connect with X25519 or P-256 unless your policy says otherwise.

Reload and check the syntax:

nginx -t
systemctl reload nginx

Prove the origin negotiated it

From an OpenSSL 3.5+ client:

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

Expected:

Negotiated TLS1.3 group: X25519MLKEM768

If you test the public hostname and it resolves to a CDN, you have tested the edge, not the origin. Test the origin hostname or IP directly where your network allows it.

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 the certificate trusted and current?
OpenSSL via the Security expertWhich protocol, cipher and group were used?

Add the host with the endpoint that matches the question. Use an agent that can reach the origin. For a CDN-fronted site, add both the public hostname and the origin (if reachable) so the two hops are separate results.

Read the result

Say: “The origin negotiated X25519MLKEM768 from the EU agent.” Do not say: “The site is quantum-safe.” The check covers one connection from one agent. It does not prove that every edge, client or backend is configured the same way.

A classical result means the tested connection did not negotiate the group. Check the linked OpenSSL, the directive, the CDN path and whether the client offered the group.

Version matrix

nginx / OpenSSLHybrid groupAction
nginx built with OpenSSL 3.5+AvailableSet the group list
nginx with an older OpenSSLNot availableUpgrade the build
CDN in front of nginxEdge may differTest the origin separately

Failure example

The CDN test shows post-quantum, but the origin test stays classical. The CDN terminates TLS and nginx links OpenSSL 3.0. Testing the origin directly exposes the older library; upgrading nginx or its OpenSSL fixes the hop the CDN does not cover.

Automate it

  • A Command Processor can collect nginx -V, the linked OpenSSL, the effective ssl_ecdh_curve/ssl_conf_command lines and certificate paths.
  • An AgentFlow can inventory the host, add the quantum and certificate checks, run both and render a report.
  • A Connect can run the quantum check on a schedule and alert when the group regresses.
  • Alerts on https expiry cover the certificate; they do not prove the key exchange.

What can go wrong

  • nginx is linked to an older OpenSSL even though the shell has 3.5.
  • The CDN terminates TLS and the origin is never tested.
  • ssl_ecdh_curve is set to a list that omits the hybrid group.
  • A client pins a classical group and the server has no fallback.
  • The certificate is classical while the session is hybrid; that is expected.

Rollback

Keep the previous ssl_protocols and group configuration. On failure, restore the old file, run nginx -t, reload, and verify the previous group is back.

Limits

  • One target, one port and one agent per check.
  • The agent's library set matters.
  • Key exchange and certificate signatures are separate.
  • No data-at-rest or QKD coverage.
  • A clean check is not proof that every virtual host or backend is configured correctly.

Next

Common questions

Why does the CDN show post-quantum but my origin does not?

The browser-to-CDN hop and the CDN-to-origin hop are separate TLS connections. A CDN can negotiate hybrid ML-KEM with the browser and still open a classical connection to your origin. Test the public hostname and the origin separately, from agents that can reach each one.

Which nginx directive sets the hybrid group?

Use ssl_ecdh_curve with X25519MLKEM768 first, or ssl_conf_command Groups on builds that expose OpenSSL's configuration command. Keep a classical fallback such as X25519 or prime256v1. The nginx binary must link OpenSSL 3.5 or later.

How do I verify the origin?

Run openssl s_client from a 3.5+ client against the origin hostname and look for the negotiated TLS 1.3 group. For recurring evidence, add the host on quantum and quantumcert from an agent that can reach the origin, and record the agent and date.

Keep exploring

Quantum-secure OpenSSL: hybrid TLS that actually negotiates

Enable hybrid ML-KEM key exchange on OpenSSL 3.5+, prove the negotiated group, and separate the session from the certificate.

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 Cloudflare: test both hops

Cloudflare may protect the browser-to-edge hop while the origin stays classical. Measure both and fix the hop you own.

Browse the library · Quantum readiness docs · Check a system