Post-quantum TLS readiness
Enable hybrid PQC on Go
Go 1.24+ enables X25519MLKEM768 by default when Config.CurvePreferences is nil. The usual fix is to stop pinning a classical-only list, or to include X25519MLKEM768 in it.
Minimum versions
Go 1.24 or later (released February 2025). crypto/tls enables the X25519MLKEM768 hybrid key exchange by default when CurvePreferences is nil. GODEBUG=tlsmlkem=0 turns that default off.
Configuration
crypto/tls.Config
import "crypto/tls"
// Preferred on Go 1.24+: leave CurvePreferences unset so the default
// (which includes X25519MLKEM768, plus classical groups) is used.
cfg := &tls.Config{
MinVersion: tls.VersionTLS12,
// CurvePreferences: nil,
}
// If you already pin the list, include the hybrid group. From Go 1.24
// the *order* of CurvePreferences is ignored; the package uses its own
// preference order. A list that omits X25519MLKEM768 disables it.
cfg.CurvePreferences = []tls.CurveID{
tls.X25519MLKEM768, tls.X25519, tls.CurveP256,
}
How to verify
openssl s_client -tls1_3 -groups X25519MLKEM768 -connect HOST:443 </dev/null 2>&1 | grep -E "Negotiated TLS1.3 group|Server Temp Key|handshake failure"
# Expect: Negotiated TLS1.3 group: X25519MLKEM768
# Needs OpenSSL 3.5+ on the machine running the command (otherwise a failure is a false negative).
# Or: pqcscan HOST
Notes
- Check `go.mod` (`go` 1.24 or higher) and the toolchain (`go version`). Propose a version bump instead of editing CurvePreferences if the module is still on Go 1.23 or older.
- Search for `GODEBUG=tlsmlkem=0` in deployment manifests and Dockerfiles; that setting disables the default hybrid group.
- Do not rotate certificates as part of this change.
Fix with your agent
Paste this into Cursor, Claude Code or Codex in the repo that terminates TLS. Review the PR, and test in staging first. The packaged skill is not published yet.
You are fixing TLS key exchange for post-quantum readiness (hybrid X25519MLKEM768).
1. If I have a pqc-report.json, read it. Otherwise run:
openssl s_client -tls1_3 -groups X25519MLKEM768 -connect HOST:443 </dev/null
(needs OpenSSL 3.5+; a handshake failure means the server does not offer hybrid).
2. Find TLS config in this repo: nginx (ssl_ecdh_curve), Caddy (tls { curves }), HAProxy (ssl-default-bind-curves),
Node (ecdhCurve), Go (tls.Config.CurvePreferences), Dockerfile base images.
3. Enable X25519MLKEM768 FIRST with classic fallback (X25519, secp256r1). Never remove the fallback.
4. Flag anything pinned to OpenSSL < 3.5, Go < 1.24 or an old Node, and propose a version bump. Do not bump silently.
5. If TLS terminates at Cloudflare or an AWS ALB/CloudFront, tell me to change that service's TLS policy instead of editing origin config.
6. Grep for RSA/ECDH/ECDSA usage in code and add `// TODO(crypto-agility)` comments only. Do not change certificates or key types.
7. Open a PR that explains each change, how to verify it, and how to roll back.
Sources
- Go 1.24 release notes: X25519MLKEM768 enabled by default, tlsmlkem=0, CurvePreferences order ignored
- pkg.go.dev/crypto/tls: Config.CurvePreferences
Reviewed 4 Dec 2026 against the official pages linked above. If a vendor page has since changed, follow the vendor page. Other stacks: nginx · Caddy · HAProxy · Node.js · OpenSSL · Cloudflare · AWS Application Load Balancer · Java (JDK)