Security

How to enable post-quantum TLS 1.3 with X25519MLKEM768

Capy team

To enable post-quantum TLS 1.3 key exchange, upgrade your TLS stack to a build that supports RFC 10024 hybrid groups, such as OpenSSL 3.5, Go 1.24 or later, or an AWS ALB PQ security policy, and add X25519MLKEM768 to your server's key exchange group list. In TLS 1.3, key exchange groups are configured separately from cipher suites, so set ssl_ecdh_curve in nginx, ssl-default-bind-curves in HAProxy, ecdh_curves in Envoy, or remove explicit CurvePreferences overrides in Go. Verify live endpoints with openssl s_client -groups X25519MLKEM768 -brief and confirm the output prints Negotiated TLS1.3 group: X25519MLKEM768 before removing 256-bit elliptic curves like secp256r1.

Turning on post-quantum cryptography (PQC) for TLS 1.3 key exchange is a configuration change on proxies, load balancers and application servers once those binaries link against a recent cryptographic library. Unlike certificate and PKI migrations, hybrid key exchange requires no new certificate authorities and no client trust-store changes.

Why key exchange comes first

A weak key exchange exposes recorded sessions retroactively, while signatures only need to hold at verification time. In its December 2026 press release, NSA warned that adversaries are already collecting encrypted information to decrypt once the capabilities become available. Traffic recorded while an endpoint negotiates classical 256-bit key exchange stays exposed to that harvest now, decrypt later threat.

In the December 2 joint statement from ONCD, NSA and CISA, the agencies stated that recent discoveries disclosed by frontier AI companies "do not present an immediate and widespread threat" to cryptography currently in use. At the same time, they called on industry and government to upgrade digital infrastructure quickly. NSA's advisory, Immediate Actions to Push Toward Post-Quantum (PP-26-4956), orders its six steps so quick wins with the broadest reach land first. Right after Step 1 (building a cryptographic inventory), Step 2 is "Move TLS services to TLS 1.3 with approved crypto profiles", including configuring hybrid key exchange per IETF RFC 10024 and removing weaker elliptic-curve options.

Cryptographer Filippo Valsorda offers a sharper reading of the advisory. In his analysis of the NSA advisory, he concludes that 256-bit elliptic curves (P-256 and Curve25519, covering X25519 and Ed25519) "are likely broken or significantly weaker than we thought", identifies ML-KEM and ML-DSA as what to move to ASAP, and puts getting TLS connections onto X25519MLKEM768 and dropping 256-bit ECC key exchange at the top of his list.

Start from a complete list of endpoints and TLS terminators before editing configs. The guide on scanning a codebase for RSA and ECC covers building that inventory across code, infrastructure definitions and live handshakes, and the post-quantum migration guide maps the full six-step program and NIST timelines. TLS certificates, internal PKI, SSH and code signing are separate steps covered in moving JWT, SSH, certificates and code signing off 256-bit ECC.

How X25519MLKEM768 works in TLS 1.3

IETF RFC 10024, published as a Proposed Standard in August 2026, defines hybrid key exchange mechanisms for TLS 1.3 that pair ML-KEM (FIPS 203) with a classical elliptic curve. The default internet choice is X25519MLKEM768 (codepoint 4588, 0x11EC), which combines ML-KEM-768 with X25519 in one handshake round trip. Both halves feed into the TLS 1.3 key schedule, so the session secret holds as long as either ML-KEM-768 or X25519 remains secure.

ML-KEM keys and ciphertexts are much larger than elliptic-curve points. An X25519MLKEM768 client key share is 1,216 bytes (1,184 bytes for ML-KEM-768 plus 32 bytes for X25519), and the server key share is 1,120 bytes.

RFC 10024 defines two other named hybrid groups alongside X25519MLKEM768:

  • SecP256r1MLKEM768 pairs NIST P-256 with ML-KEM-768 for stacks standardized on NIST curves.
  • SecP384r1MLKEM1024 pairs P-384 with ML-KEM-1024.

NSA's CNSA 2.0 profile specifies ML-KEM-1024 rather than ML-KEM-768, while NSA advisory PP-26-4956 explicitly permits hybrid key exchange configured per RFC 10024. If you operate National Security Systems or align with CNSA 2.0, include SecP384r1MLKEM1024 in your server group list. For general commercial services, X25519MLKEM768 has the widest support across browsers and TLS stacks. Listing both X25519MLKEM768 and SecP384r1MLKEM1024 lets each peer negotiate its preferred hybrid.

Why cipher-suite hardening does nothing for PQ

A footnote in Step 2 of NSA advisory PP-26-4956 flags a common TLS 1.3 trap: "TLS 1.3 selects algorithms differently than TLS 1.2. In particular, the key establishment mechanism must be separately configured."

In TLS 1.2, a cipher suite string bundled key exchange, authentication, symmetric encryption and hash together. In TLS 1.3, cipher suites such as TLS_AES_256_GCM_SHA384 choose only the symmetric cipher and HKDF hash. Hardening cipher suites alone leaves your server negotiating classical X25519 or secp256r1. Every server below controls key exchange through its own group or curve directive.

Configuring servers, proxies, Go and cloud load balancers

Confirm that each server binary links against a TLS library implementing RFC 10024 before rolling out config changes. Directives differ across stacks, and some runtimes silently ignore or drop hybrid defaults.

OpenSSL 3.5 prerequisite

OpenSSL 3.5 adds native support for ML-KEM (FIPS 203), ML-DSA (FIPS 204), SLH-DSA (FIPS 205) and the RFC 10024 hybrid groups. Stock OpenSSL 3.0.x shipped on many LTS Linux distributions lacks ML-KEM and cannot negotiate or test X25519MLKEM768. Check the installed version and KEM list first:

openssl version
openssl list -kem-algorithms

On OpenSSL 3.5 or newer, openssl list -kem-algorithms prints ML-KEM-512, ML-KEM-768, ML-KEM-1024, X25519MLKEM768 and SecP256r1MLKEM768. If those entries are missing, upgrade OpenSSL or your container base image before editing proxy configs.

nginx

Post-quantum support in nginx depends on the OpenSSL library it links against. Run nginx -V and check the "built with OpenSSL" line to confirm OpenSSL 3.5 or newer.

Set the named groups with ssl_ecdh_curve in ngx_http_ssl_module and require TLS 1.3 where legacy clients allow:

ssl_protocols TLSv1.3;
ssl_ecdh_curve X25519MLKEM768:SecP384r1MLKEM1024:X25519:secp384r1;

If older clients still need TLS 1.2 on that virtual host, use ssl_protocols TLSv1.2 TLSv1.3; until you retire them. Because secp256r1 is omitted from ssl_ecdh_curve, any client offering only P-256 fails the handshake.

HAProxy

On HAProxy built with OpenSSL 3.5, set the default curves globally with ssl-default-bind-curves in the global section:

global
    ssl-default-bind-curves X25519MLKEM768:X25519:secp384r1

You can also set curves per listener with the curves keyword on a bind line:

frontend https_in
    bind :443 ssl crt /etc/haproxy/certs/site.pem curves X25519MLKEM768:X25519:secp384r1

A TLS 1.2 client hitting that same listener falls back to classical ECDHE because RFC 10024 hybrids exist only in TLS 1.3.

Envoy

In non-FIPS builds of Envoy v1.36, the default curves are X25519 and P-256, so Envoy does not offer X25519MLKEM768 unless you set ecdh_curves explicitly. Configure ecdh_curves inside DownstreamTlsContext under common_tls_context.tls_params per Envoy's TLS configuration reference:

common_tls_context:
  tls_params:
    ecdh_curves:
      - X25519MLKEM768
      - X25519
      - P-384

Apply the same ecdh_curves list on upstream TLS contexts wherever Envoy acts as a client to internal services or service mesh peers, so sidecar-to-sidecar connections negotiate hybrid key exchange too.

Go crypto/tls

Go's crypto/tls package includes tls.X25519MLKEM768 in its default CurvePreferences starting in Go 1.24. Starting in Go 1.26, the defaults also include tls.SecP256r1MLKEM768 and tls.SecP384r1MLKEM1024. Go binaries built on 1.24 or later negotiate hybrid key exchange automatically unless one of three traps overrides it:

  • Explicit CurvePreferences overrides. Old hardening snippets set CurvePreferences: []tls.CurveID{tls.X25519, tls.CurveP256}. Any non-empty CurvePreferences slice replaces Go's defaults and silently drops every hybrid group.
  • GODEBUG disable flags. Setting GODEBUG=tlsmlkem=0 disables X25519MLKEM768, and GODEBUG=tlssecpmlkem=0 disables the NIST-curve hybrids. Grep Dockerfiles, environment files and godebug lines in go.mod for both flags.
  • Assumed slice order. Go ignores the order of entries in CurvePreferences and uses its own internal preference order.

Leaving CurvePreferences nil on Go 1.24 or later keeps hybrid defaults enabled alongside classical fallbacks. When you are ready to drop 256-bit elliptic curves such as tls.CurveP256 and classical tls.X25519, list the allowed hybrid groups and interim P-384 explicitly:

tlsConfig := &tls.Config{
	MinVersion: tls.VersionTLS13,
	CurvePreferences: []tls.CurveID{
		tls.X25519MLKEM768,
		tls.SecP384r1MLKEM1024,
		tls.CurveP384,
	},
}

AWS Application Load Balancer and other cloud edges

AWS Application Load Balancer security policies with PQ in the name offer hybrid post-quantum key exchange (X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024) on TLS 1.3 only. In its ALB security policy documentation, AWS recommends ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09, or ELBSecurityPolicy-TLS13-1-2-Res-FIPS-PQ-2025-09 for FIPS workloads.

Watch the default policy in infrastructure as code. While ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09 is the AWS Console default, the default for the AWS CLI, CloudFormation and CDK is still ELBSecurityPolicy-2016-08. Listeners defined in code without an explicit policy silently deploy without PQ support. Set ssl_policy explicitly in Terraform:

resource "aws_lb_listener" "https" {
  load_balancer_arn = aws_lb.edge.arn
  port              = 443
  protocol          = "HTTPS"
  ssl_policy        = "ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09"
  certificate_arn   = aws_acm_certificate.edge.arn

  default_action {
    type             = "forward"
    target_group_arn = aws_lb_target_group.app.arn
  }
}

For CDNs and other cloud load balancers, check the provider's TLS policy documentation for RFC 10024 hybrid key exchange support and verify whether CLI or Terraform defaults differ from the web console.

Verifying negotiated groups with OpenSSL 3.5

A config syntax check confirms only that a file parses. Probe every updated listener from a host or container with OpenSSL 3.5 or newer, because stock OpenSSL 3.0.x cannot offer X25519MLKEM768 and rejects the group flag:

openssl s_client -connect example.com:443 -groups X25519MLKEM768 -brief </dev/null

A working endpoint prints the negotiated protocol and group:

Protocol version: TLSv1.3
Ciphersuite: TLS_AES_256_GCM_SHA384
Negotiated TLS1.3 group: X25519MLKEM768

Once you remove 256-bit elliptic curves like P-256 from the server's group list, run a negative test to confirm a P-256-only client is refused:

openssl s_client -connect example.com:443 -groups secp256r1 -brief </dev/null

If that handshake succeeds instead of failing, either the server still advertises secp256r1 or an upstream proxy terminates TLS with an older policy.

Deciding when to drop classical 256-bit groups

Enabling X25519MLKEM768 does not eliminate classical key exchange on its own. Keeping X25519 or secp256r1 as a fallback group lets older clients connect over classical ECDHE, while removing them breaks any client that cannot negotiate a hybrid group or P-384.

NSA advisory PP-26-4956 Step 2 calls for removing weaker elliptic-curve options from key exchange preferences, and Step 5 warns against leaving non-PQC defaults in place after upgrading. To reach that state without blind outages, roll out the removal in stages:

  1. Add X25519MLKEM768 (and SecP384r1MLKEM1024 where CNSA 2.0 applies) ahead of your existing groups, and retain secp384r1 as an interim stopgap for classical TLS 1.3 clients that support P-384.
  2. Log the negotiated TLS version and key exchange group at your edge proxies and internal gateways to identify clients still picking classical X25519, secp256r1 or TLS 1.2.
  3. Upgrade or isolate those clients, remove secp256r1 and classical X25519 from the server list, and re-run the negative openssl s_client -groups secp256r1 probe.

P-384 is an interim stopgap rather than a quantum-resistant replacement, so keep tracking clients that rely on secp384r1 until they move to an RFC 10024 hybrid.

Common rollout gotchas

Even cleanly configured TLS 1.3 servers hit four operational issues during a hybrid key exchange rollout.

ClientHello packet size and middleboxes. An X25519MLKEM768 client key share is 1,216 bytes, pushing the TLS 1.3 ClientHello past a single standard packet. Older firewalls, transparent proxies and inspection middleboxes with fixed-size buffers can stall or drop multi-packet ClientHellos. Test behind corporate egress firewalls, VPN gateways and partner networks before changing production listeners.

TLS 1.2 clients get no PQ protection. RFC 10024 hybrid groups exist only in TLS 1.3. A listener accepting TLSv1.2 and TLSv1.3 silently falls back to classical ECDHE for every TLS 1.2 client. Disable TLS 1.2 wherever possible, and restrict unavoidable TLS 1.2 endpoints to CNSA 1.0 interim algorithms (P-384 or RSA-3072) while documenting them for replacement.

Client side matters too. Updating public load balancers protects inbound traffic only when callers offer X25519MLKEM768, and leaves outbound connections unchanged. Audit outbound HTTP clients, Envoy service mesh sidecars, database drivers and container images still shipping stock OpenSSL 3.0.x, because an old client silently negotiates classical key exchange even against a PQ-enabled server.

FIPS builds follow separate policies. FIPS-validated modules and cloud load balancer FIPS policies restrict allowed curves and adopt new groups on a separate schedule from non-FIPS builds. On AWS ALB, pick a FIPS PQ policy such as ELBSecurityPolicy-TLS13-1-2-Res-FIPS-PQ-2025-09 rather than an older FIPS policy, and confirm the negotiated group with openssl s_client.

Rolling out TLS changes across infrastructure repositories with Capy

TLS settings rarely live in one repository. They sit across Terraform load balancer modules, Helm charts, Envoy sidecar templates, nginx and HAProxy configs, and Go services with custom tls.Config structs.

In Capy, a Captain runs this rollout using the pilot-then-fan-out method in running a code migration across many repositories. Put your infrastructure repositories in one project, write the target group list, GODEBUG checks and verification commands once in the Captain's CREW.md, and run a pilot on one representative repository before fanning out one thread per repository.

Each thread runs on its own isolated cloud microVM with the repository cloned and your Setup applied. The thread updates the TLS config, starts a local test server (nginx, HAProxy, Envoy or a Go test listener) inside its cloud machine, and runs both openssl s_client -groups X25519MLKEM768 -brief and openssl s_client -groups secp256r1 -brief before opening a pull request. Each thread follows its pull request through CI and review feedback on the same branch, while Capy leaves merging to a human reviewer unless an explicit merge rule is committed in the repository's root AGENTS.md.

To keep classical 256-bit defaults from returning in new services, add a rule to each repository's AGENTS.md so Capy Review flags any TLS configuration without X25519MLKEM768, any AWS ALB listener without a PQ policy, or any P-256-only key exchange group as an inline pull request finding on GitHub.

Frequently Asked Questions

Does enabling X25519MLKEM768 break older browsers and TLS clients?+
Adding X25519MLKEM768 to your TLS 1.3 group list does not break older clients while a classical fallback group such as X25519 or secp384r1 remains enabled. Clients that support RFC 10024 hybrids negotiate X25519MLKEM768, and older clients fall back to a shared classical group. Clients only break when you remove classical 256-bit curves from the server list, so log negotiated groups before removing fallback options.
Why does my nginx or HAProxy config fail to recognize X25519MLKEM768?+
Both nginx and HAProxy depend on the OpenSSL library they were compiled against for post-quantum key exchange. Stock OpenSSL 3.0.x shipped on many LTS Linux distributions lacks ML-KEM and RFC 10024 hybrid groups. Check nginx -V or your HAProxy build output and upgrade to a build linked against OpenSSL 3.5 or newer.
Is Go crypto/tls post-quantum by default, or do I need to set CurvePreferences?+
Go 1.24 enables X25519MLKEM768 by default when CurvePreferences is left unset, and Go 1.26 adds SecP256r1MLKEM768 and SecP384r1MLKEM1024 to the defaults. Setting CurvePreferences explicitly to classical curves like tls.X25519 and tls.CurveP256 silently drops all hybrid groups. Check Dockerfiles, environment files and go.mod godebug lines for GODEBUG=tlsmlkem=0 or tlssecpmlkem=0 as well, because those flags turn hybrid key exchange off.
Should I configure X25519MLKEM768 or SecP384r1MLKEM1024 for TLS 1.3?+
Most internet-facing services should enable X25519MLKEM768 first because it has the widest client support across browsers and TLS libraries. Organizations aligning with CNSA 2.0 need ML-KEM-1024, which maps to SecP384r1MLKEM1024 in RFC 10024. You can list both groups in your server configuration so CNSA 2.0 peers negotiate SecP384r1MLKEM1024 while general clients negotiate X25519MLKEM768.
Does enabling post-quantum TLS 1.3 key exchange protect TLS certificates and signatures?+
No. Hybrid key exchange with X25519MLKEM768 protects session confidentiality against recorded traffic being decrypted later, while server authentication still relies on X.509 certificates and classical signatures such as ECDSA or RSA. Migrating certificate authorities, leaf certificates and signing keys is a separate phase that follows key exchange.
Why is my AWS Application Load Balancer not negotiating X25519MLKEM768 on TLS 1.3?+
The AWS Console defaults new Application Load Balancer listeners to ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09, which includes hybrid post-quantum key exchange, while the AWS CLI, CloudFormation and CDK still default to ELBSecurityPolicy-2016-08. If your Terraform, CloudFormation or CDK definitions omit an explicit ssl_policy, the listener runs without post-quantum groups. Set ssl_policy to ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09 or its FIPS equivalent and verify with OpenSSL 3.5.

Sources

  1. CISA: Joint statement from ONCD, NSA and CISA on recent advances in cryptographic and cybersecurity capabilities
  2. NSA: NSA advises immediate transition to post-quantum cryptography
  3. NSA: Immediate Actions to Push Toward Post-Quantum (PP-26-4956)
  4. Filippo Valsorda: What to Make of the NSA Advisory
  5. IETF RFC 10024: Post-Quantum Traditional (PQ/T) Hybrid Key Agreement Mechanisms for TLS 1.3
  6. nginx: ngx_http_ssl_module
  7. Envoy: TLS common configuration
  8. Go: crypto/tls package
  9. AWS: Security policies for your Application Load Balancer
  10. Capy docs: Captains

Spotted something out of date? Tell us at support@capy.ai.