Node.js uses OpenSSL for TLS, and its default ecdhCurve is auto, which means OpenSSL's built-in group list. Official Node.js 24.5.0+ and 22.20.0+ builds bundle OpenSSL 3.5, so a Node HTTPS server offers X25519MLKEM768 out of the box.
Requirements
- Official Node.js 24.5.0 or newer (ships OpenSSL 3.5.1 or later), or Node.js 22.20.0 or newer (ships OpenSSL 3.5.2 or later). Later major lines also bundle OpenSSL 3.5+.
- TLS 1.3 allowed. Node's default maximum is TLS 1.3.
- If your Node is built against a system OpenSSL (common in Linux distribution packages), that library must be 3.5 or newer.
Check what you run:
node -p "process.versions.openssl"
Enable it
With the default settings, nothing is needed. If your code sets ecdhCurve, or you want the order explicit, list the hybrid group first where you create the server:
import https from 'node:https';
import fs from 'node:fs';
const server = https.createServer({
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem'),
minVersion: 'TLSv1.2',
ecdhCurve: 'X25519MLKEM768:X25519:P-256',
}, (req, res) => {
res.end('ok');
});
server.listen(443);
The Node docs describe ecdhCurve as a colon-separated list of named curves or TLS groups, and in TLS 1.3 it sets the supported groups and key shares. The same option works in tls.createServer() and tls.createSecureContext().
To change the default for every TLS context in a process, set tls.DEFAULT_ECDH_CURVE before creating servers.
Check it worked
From a machine with an OpenSSL 3.5 or newer client:
openssl s_client -connect example.com:443 -servername example.com \
-groups X25519MLKEM768 -tls1_3 </dev/null 2>/dev/null | grep -i "group"
You should see Negotiated TLS1.3 group: X25519MLKEM768. From a Node client, the current docs say socket.getEphemeralKeyInfo() can report the negotiated group with type: 'TLSGroup' and the group in name.
Run a free check at https://isquantumsafe.net/ to see the negotiated group and your grade.