Post-Quantum Verified

Migration guide

Enable and verify X25519MLKEM768 on a Node.js TLS or HTTPS server

Set the ecdhCurve option on tls.createServer or https.createServer so a Node.js server offers the hybrid group X25519MLKEM768, and check the result with openssl s_client.

Lab validated Last reviewed 2026-12-04

How this guide was validated. Run on 2026-12-04, loopback only. Node.js v24.13.1 (OpenSSL 3.5.5): tls.createServer and https.createServer with ecdhCurve set to X25519MLKEM768:X25519 and to X25519, using a throwaway ECDSA P-256 certificate generated in memory (no key written to disk). Verified with OpenSSL 3.6.2 and 4.1.0 s_client (default offer, and -groups X25519) and with a Node tls.connect client. Not run: other Node versions, and a production-style setup. node -p "process.versions.openssl" shows the OpenSSL in your build.

Applies to

  • Node.js built with OpenSSL 3.5 or later (lab-run on v24.13.1 with OpenSSL 3.5.5)

Before you start

  • Node.js whose bundled OpenSSL is 3.5 or later. Check with node -p "process.versions.openssl". Node 24.13.1 reports 3.5.5.
  • Your existing certificate and key loading code.

Steps

  1. Check Node and its OpenSSL
    Hybrid groups come from the OpenSSL inside Node.
    node -v
    node -p "process.versions.openssl"

    Expect: In the lab: v24.13.1 and 3.5.5.

  2. Add ecdhCurve to the server options
    ecdhCurve takes a colon-separated list of curves or TLS groups. In TLS 1.3 it sets the groups the server accepts. Put the hybrid group first and keep a classical group so other clients still connect. The same option works for tls.createServer and https.createServer (which takes TLS options). If you use ECDSA certificates, keep the certificate curve in the list: for a prime256v1 certificate, add prime256v1.
    const server = https.createServer({ key, cert, ecdhCurve: 'X25519MLKEM768:X25519:prime256v1' }, handler);
    server.listen(8443);

    Expect: The server starts. In the lab, the same string without prime256v1 also worked with a prime256v1 certificate over TLS 1.3, but listing it is the safer choice for older clients.

  3. Restart the process
    ecdhCurve is read when the server is created, so restart or redeploy the service.

Verify

  1. Check from outside with OpenSSL 3.5+ s_client
    This is the reliable check. Replace the host and port with your own.
    openssl s_client -connect example.com:8443 -servername example.com </dev/null 2>&1 | grep -E "Negotiated TLS1.3 group|Peer Temp Key"

    Expect: "Negotiated TLS1.3 group: X25519MLKEM768". Seen in the lab on OpenSSL 3.6.2 and 4.1.0. A server configured with only X25519 showed "Peer Temp Key: X25519, 253 bits" instead.

  2. Do not rely on getEphemeralKeyInfo() in Node 24.13.1
    In the lab, a Node client connected to the hybrid server over TLSv1.3 got an empty object from socket.getEphemeralKeyInfo(), while a classical connection gave { type: 'ECDH', name: 'X25519', size: 253 }. The current Node documentation describes a TLSGroup type for this case, but it did not appear on v24.13.1. An empty object here is not evidence of a classical connection.
    socket.getEphemeralKeyInfo()

    Expect: On Node v24.13.1: {} for a hybrid connection (lab result). Use s_client for the answer.

Roll back

  1. Remove ecdhCurve and restart
    Delete the ecdhCurve option (the default is tls.DEFAULT_ECDH_CURVE, which is auto on v24.13.1). Restart the service. Re-run the verify step to see what your Node build negotiates by default.
    node -p "require('tls').DEFAULT_ECDH_CURVE"

    Expect: Prints auto on v24.13.1.

What this guide does not cover

  • A key-exchange result says nothing about authentication: the certificate and its signature are a separate question, and certificate signatures are not made post-quantum by this change.
  • Only the Node server socket is covered. A reverse proxy, load balancer or CDN in front of Node terminates its own TLS connection. See cdn-edge-and-origin.
  • Outbound connections from Node (fetch, https.request) are configured separately and not covered here.
  • Behaviour on Node versions other than v24.13.1 was not tested.
  • The hybrid ClientHello is larger. Test from the networks your users use.

Sources

Only change systems you own or are authorized to change. Have a person approve each change and keep a rollback.