isquantumsafe Check a domain

isquantumsafe / Guides / Java (JDK / JSSE)

Post-quantum TLS on Java (JDK / JSSE)

JDK 27 enables X25519MLKEM768 hybrid post-quantum key exchange (ML-KEM) in TLS 1.3 by default. How to set jdk.tls.namedGroups, what older JDKs lack, and tests.

Default
On by default
You need
JDK 27 (JEP 527)
Updated
4 December 2026 · 3 sources

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.

Common problems

  • Running JDK 25 or 21. These releases have no hybrid TLS groups. Until you can move to JDK 27, terminate TLS in front of the app with a proxy that supports ML-KEM, such as nginx on OpenSSL 3.5, or a CDN.
  • An old jdk.tls.namedGroups value. A list without X25519MLKEM768, set in a startup script or JAVA_TOOL_OPTIONS, replaces the default and turns ML-KEM off.
  • TLS 1.2 only. If jdk.tls.server.protocols or the connector config allows only TLS 1.2, hybrid key exchange never happens.
  • Native TLS in the app server. Tomcat with the APR/OpenSSL connector or Netty with netty-tcnative uses OpenSSL, not JSSE. Follow the OpenSSL 3.5 requirements from the nginx guide instead.

Sources

  1. JEP 527: Post-Quantum Hybrid Key Exchange for TLS 1.3 (OpenJDK)
  2. Post-Quantum Hybrid Key Exchange for TLS 1.3 (inside.java)
  3. Quality Outreach Heads-up - JDK 27: Post-Quantum Hybrid Key Exchange for TLS 1.3 (inside.java)

Other guides: Languages and runtimes