The JDK's built-in TLS stack (SunJSSE) supports hybrid ML-KEM key exchange from JDK 27, delivered by JEP 527. In JDK 27, X25519MLKEM768 sits at the front of the default named groups list, so Java servers and clients use it with no code changes. JDK 25 LTS and older releases do not have it.
Requirements
- JDK 27 or newer. JEP 527 is marked Closed / Delivered in release 27.
- TLS 1.3. JEP 527 adds hybrid key exchange to TLS 1.3 only.
- Supported hybrid names:
X25519MLKEM768 (on by default), SecP256r1MLKEM768 and SecP384r1MLKEM1024 (available, but off by default).
- The server or framework must use JSSE. Tomcat, Jetty and Netty can also run on OpenSSL-based TLS engines; in that case the OpenSSL version decides.
Check your runtime with java -version.
Enable it
On JDK 27 with default settings, nothing is needed. The JEP gives the full default order:
X25519MLKEM768, x25519, secp256r1, secp384r1, secp521r1, x448, ffdhe2048, ffdhe3072, ffdhe4096
If your deployment sets jdk.tls.namedGroups, put the hybrid first. Pass it as a system property when you start the JVM:
java -Djdk.tls.namedGroups="X25519MLKEM768,x25519,secp256r1,secp384r1" -jar app.jar
Or set the groups in code on a socket or engine, as shown in JEP 527:
SSLParameters params = sslSocket.getSSLParameters();
params.setNamedGroups(new String[] {
"X25519MLKEM768", "x25519", "secp256r1"
});
sslSocket.setSSLParameters(params);
Keep x25519 and secp256r1 in the list so clients without ML-KEM can still connect.
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. On the Java side, starting the JVM with -Djavax.net.debug=ssl:handshake logs the key share groups in each handshake.
Run a free check at https://isquantumsafe.net/ to see the negotiated group and your grade.