Post-quantum TLS readiness
Enable hybrid PQC on Node.js
If your Node build bundles OpenSSL 3.5 or later and ecdhCurve is left at the default 'auto', hybrid X25519MLKEM768 is already preferred. Check process.versions.openssl before changing anything.
Minimum versions
A Node.js build whose `process.versions.openssl` is 3.5 or later. Official Node.js 22.20.0 (24 Sep 2025) updated default-configured builds to OpenSSL 3.5.2. Distro packages may still link an older system OpenSSL — always check the runtime, not just the Node version.
Configuration
tls.createServer / https.createServer options
import https from 'node:https';
// First, confirm: node -p "process.version + ' OpenSSL ' + process.versions.openssl"
// If OpenSSL < 3.5, upgrade Node (or the distro package) before changing config.
const server = https.createServer({
key, cert,
minVersion: 'TLSv1.2',
// Default is tls.DEFAULT_ECDH_CURVE === 'auto', which uses OpenSSL's list.
// On OpenSSL 3.5+ that list already prefers X25519MLKEM768.
// Set an explicit list only if you currently pin classical groups:
ecdhCurve: 'X25519MLKEM768:X25519:P-256',
});
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
- The official Node.js `tls.createSecureContext()` docs list `X25519MLKEM768` as a valid `ecdhCurve` / TLS group name. In TLS 1.3 this option configures supported groups and key shares.
- A pinned list such as `X25519:P-256` removes the hybrid group. Either switch back to `'auto'` or put `X25519MLKEM768` first and keep a classical fallback.
- Do not guess a Node version bump from the major number alone. Use `node -p process.versions.openssl`.
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
- Node.js docs: tls.createSecureContext() ecdhCurve (includes X25519MLKEM768)
- Node.js 22.20.0 release: official builds bundle OpenSSL 3.5.2
- OpenSSL 3.5: default group list prefers X25519MLKEM768
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 · Go · OpenSSL · Cloudflare · AWS Application Load Balancer · Java (JDK)