Fix post-quantum TLS errors in Java

If a Java TLS connection fails after a JDK upgrade on a hybrid group such as X25519MLKEM768, the application's JVM offers a key exchange the peer cannot handle. The developer or platform team that owns the JVM and its TLS configuration has to act.

On this page

Why Java TLS connections fail on hybrid key exchange after an upgrade

If a Java client or service that connected to a server before now fails to connect after you moved to JDK 25.0.5 or JDK 27, the likely cause is a change in the default key exchange, not a broken certificate or a changed endpoint. Starting with JDK 25.0.5, the JDK backport of JEP 527 (JDK-8314323, Post-Quantum Hybrid Key Exchange for TLS 1.3) enables the hybrid group X25519MLKEM768 by default and makes it the most preferred group, according to the Shipilev JDK 25.0.5 release notes. JDK 27 does the same, as described in the Oracle JSSE Reference Guide for JDK 27. Because a default TLS client now sends a key share for the hybrid group, its ClientHello grows. The failure you see is typically a handshake that never completes, reported by the application as a connection error. When the handshake fails, no encrypted session is established, so the traffic is not protected. The team that owns the JVM version and the application's TLS setup must act, and the server owner may need to be involved if the failure is on their side.

The larger ClientHello is the root of the problem. Per the Palantir dialogue project's pull request 3288, the X25519MLKEM768 key share can push the ClientHello beyond one TCP segment. Some servers and middleboxes cannot reassemble a split ClientHello and fail the handshake instead of falling back to classic ECDHE. A server that shares no group with the client also fails the connection, which the Kroxylicious project's blog post of 19 November 2026 describes as a client that fails to connect because there is no group in common. Neither source quotes the exception text, so check your own logs for the handshake failure and confirm the cause with a debug run rather than assuming it from the message alone.

Before you change anything, confirm that the failure is tied to the upgrade. Run java -version to record the installed version, and run the application with -Djavax.net.debug=ssl:handshake to see which named group the server selected in the key_share extension of the ServerHello. If the server is outside your control, ask its owner whether it accepts a hybrid group and whether it handles a split ClientHello. The fixes that follow, such as setting jdk.tls.namedGroups or reordering groups in code, depend on that answer, so treat them as decisions to make with the server owner rather than as a default step.

Who has to act on a Java hybrid key exchange failure

A failed hybrid handshake in Java usually involves more than one team. The application code, the JVM launch settings, the peer server and the network path each control a different part of the negotiation, so the fix depends on knowing which of them you can change.

Application developers set named groups in code

If the application builds its own SSLParameters, the developer decides which named groups are offered through setNamedGroups(String[]) and applies them with setSSLParameters. Check whether the code already pins a group list that omits X25519MLKEM768 or the peer's supported groups. Changing the code requires a rebuild and redeploy, so this is the place to fix a single client that always offers the same list.

JSSE reference guide

Platform teams set system properties

The operations or platform team controls the java command line and can pass -Djdk.tls.namedGroups with a quoted, comma-separated list in preference order. This changes behavior for every application started with that command without touching code. Confirm which JDK version is installed with java -version, since the hybrid default applies from JDK 25.0.5 and JDK 27.

java command docs

Peer server owners control accepted groups

The server that the client connects to decides which groups it accepts and whether it requires a hybrid group. You cannot change this from the client side, and a third-party service may not offer a timeline for changes. Ask the owner which named groups their TLS stack supports, and use the client-side list to match what they offer.

Network teams own middleboxes

Firewalls, proxies and load balancers on the path can fail to handle a ClientHello that no longer fits in one TCP segment. The Palantir dialogue project reports that such devices can fail the handshake instead of falling back to classic ECDHE. The network team can inspect these devices, but a change to their firmware or policy is outside the application team's control.

Verify the result with debug output

After any change, run the application with -Djavax.net.debug=ssl:handshake and read the key_share extension in the ServerHello to confirm the negotiated group. The JDK 27 guide shows X25519MLKEM768 as the expected value in its sample. Test against each peer your application calls, because a change that fixes one connection can leave another unchanged.

How to check which group Java negotiated

This sequence confirms the installed Java version, then runs the application with handshake debugging on so you can read the named group that the client and server agreed on. The result shows whether the connection used X25519MLKEM768 or fell back to a classic group.

  1. Confirm the installed Java version

    Run java -version on the machine where the application runs, and run java --version as well. java -version prints the product version to the error stream, and java --version prints it to the output stream, and both commands then exit. Compare the reported version against the release that delivers the hybrid group: JEP 527 ships in JDK 27, and JDK 25 enables the hybrid group by default from update 25.0.5. If the version is older than that, the hybrid group is not offered by default, and you should check the JDK vendor's documentation for your build before changing settings. Note the version string so you can refer to it in later steps.

  2. List the available debug options

    Run java -Djavax.net.debug=help MyApp, replacing MyApp with your main class or JAR name. This prints the debug options that the runtime accepts and then exits without running the application. Look for the ssl option group and the handshake sub-option, since these are the settings used to trace the TLS negotiation in the next step. If the help output does not list handshake as an option on your build, confirm the version from the previous step before continuing.

  3. Run the application with handshake tracing

    Start the application with the -Djavax.net.debug=ssl:handshake property on the java command line, for example java -Djavax.net.debug=ssl:handshake -jar MyApp.jar. The property is passed as -Dproperty=value, and it applies for the life of that JVM process only. Trigger a TLS connection to the service that is failing, such as by running the request or the job that opens the connection. Keep the console output, because the handshake messages are written there while the connection is attempted. Expect a large volume of output, so redirect it to a file if you plan to search it later.

  4. Locate the ClientHello key share

    In the handshake output, find the ClientHello that the Java client sends and look at the key_share extension. By default a TLS client sends two key shares, one for X25519MLKEM768 and one for x25519, so you should see both groups listed. If only classic groups appear, the client has been configured to exclude the hybrid group, and you should confirm the jdk.tls.namedGroups setting before continuing. Record which groups the client offered, since a server can only agree on a group that appears in this list.

  5. Read the named group in the ServerHello

    Find the ServerHello that the server returns and read the key_share extension in it. The field labelled named group shows the group the two sides agreed on. In the JDK 27 JSSE Reference Guide's sample output this field reads X25519MLKEM768, which means the hybrid group was negotiated. If the field shows x25519 or another classic group, the server or a middlebox did not accept the hybrid group, and the connection fell back. If the handshake fails before a ServerHello appears, the failure is on the path rather than in the group choice, and you should review the handshake and middlebox guidance on this site.

  6. Record the result for the next test

    Save the Java version, the command you ran, the offered groups from the ClientHello and the named group from the ServerHello in one place. Note whether any jdk.tls.namedGroups or -Ddialogue.tls.useJvmDefaultNamedGroupsOrdering setting was in effect when you ran the test, since these change the group order the client sends. This record lets you compare the result before and after a configuration change, and it gives your team or your vendor a concrete result to check. Confirm with your platform owner which evidence they need for their internal change process.

Which causes produce the handshake error and the fix for each

This table pairs each cause of a Java TLS handshake failure on a hybrid group with the fix the sources support. Read each row as a symptom and its matching change, and check the setting in your own environment before you apply it. The main takeaway is that the JDK 27 default change is the most common trigger, and most fixes are either reordering groups or restricting jdk.tls.namedGroups.

CauseWhy it failsFix from the sources
JDK upgrade moves X25519MLKEM768 to the defaultFrom JDK 27, and from JDK 25.0.5, X25519MLKEM768 is enabled by default and is the most preferred group, so clients send a larger ClientHello.Pin the group list with jdk.tls.namedGroups or SSLParameters.setNamedGroups, or ask the peer to support the hybrid group.
No group in common with the peerThe client and server share no named group, so the client fails to connect. Kroxylicious describes this failure without quoting exception text.Add a group the peer supports to the list, such as secp256r1 or x25519, and confirm the peer's supported groups.
ClientHello split across TCP segmentsThe X25519MLKEM768 key share makes the ClientHello too large for one segment. Some servers and middleboxes cannot read a split ClientHello and fail instead of falling back to ECDHE.Move X25519MLKEM768 to the end of the list so connections start with X25519, as Palantir dialogue did in release 6.49.0, or fix the server or middlebox.
Restrictive jdk.tls.namedGroups configurationA configured list that excludes groups the peer accepts leaves no common group, or forces a hybrid group the peer does not support.Set jdk.tls.namedGroups to a list that includes a group the peer supports, or leave it undefined or empty to use the implementation defaults.

How to set jdk.tls.namedGroups or SSLParameters.setNamedGroups

These steps change which key exchange groups a Java application offers during TLS, so a connection can negotiate a classic group when the peer cannot handle a hybrid post-quantum group. You decide where the list is set, apply it, restart the application, and confirm the negotiated group in the handshake debug output.

  1. Confirm the Java version in use

    Run java -version or java --version on the host that starts the application, and note the product version. The default hybrid group X25519MLKEM768 is enabled from JDK 27 and, per the JDK 25.0.5 release notes, from update 25.0.5 on JDK 25, so a failure after an upgrade often starts at this point. Check the version on the same machine and in the same runtime image the service actually uses, because a container or service wrapper may bundle a different JDK than your shell.

  2. Choose the command-line or code method

    Decide whether to set the list with the -Djdk.tls.namedGroups system property on the java command line, or in code with SSLParameters.setNamedGroups applied through setSSLParameters. The command-line option suits a fixed deployment that you can change without rebuilding, and the code option suits a client whose TLS configuration already lives in the source. Use one method per process so you can tell which setting took effect when you test.

  3. Set the list with jdk.tls.namedGroups

    Add -Djdk.tls.namedGroups followed by a comma-separated list of group names, enclosed in quotation marks, in preference order. The JSSE Reference Guide for JDK 27 gives the example value X25519MLKEM768,secp521r1,secp256r1,ffdhe2048 as a format reference, so keep the names exactly as the guide spells them. Quote the whole value on the command line, because a value containing spaces must be enclosed in quotation marks. If the property is undefined or empty, the JVM uses its own default groups and order, so a missing or blank value does not disable the hybrid group.

  4. Set the list with SSLParameters.setNamedGroups

    In code, build an SSLParameters object for the socket or SSLEngine, call setNamedGroups with a String array in preference order, and apply the result with setSSLParameters. The JSSE guide's sample is params.setNamedGroups(new String[] {"secp256r1", "x25519", "X25519MLKEM768", "SecP256r1MLKEM768"}), which prefers two traditional groups over the default hybrid group and enables SecP256r1MLKEM768. Copy the group names from the guide, and apply the parameters to each connection object the client creates, so no connection falls back to the default order.

  5. Restart the application to load the setting

    Stop and start the application after you change the command-line property, because the JVM reads system properties only at startup. Changing the value in a running process has no effect. For the code method, rebuild and redeploy the artifact, then restart it. Confirm that the new process is the one serving traffic before you move to testing, since an old instance left running can keep the previous behavior.

  6. Verify the negotiated group in the debug output

    Start the application with -Djavax.net.debug=ssl:handshake and make one TLS connection to the failing peer. Read the key_share extension in the ServerHello, which the JDK 27 guide's sample shows as "named group": X25519MLKEM768 when the hybrid group was negotiated. If the group you set is not the one negotiated, the peer does not support your first choice, which is expected for a legacy server. Run java -Djavax.net.debug=help MyApp to list the other debug options, which prints them and exits without starting the application.

  7. Opt out of reordering in the Palantir library

    If the application uses the Palantir dialogue library, the change in release 6.49.0 moves X25519MLKEM768 to the end of the named groups list so connections start with X25519, and it applies only on JDK 20 and later. Set -Ddialogue.tls.useJvmDefaultNamedGroupsOrdering=true at JVM startup only if you want the JVM default ordering back. Treat this flag as the opt-out for that library alone, because it does not change jdk.tls.namedGroups or SSLParameters.setNamedGroups for other TLS clients in the same process. Confirm the library version your build uses before you rely on this behavior.

How the change differs between command-line, code and library setups

On a command-line launch, the JVM reads the named groups list from the system property jdk.tls.namedGroups when it starts. The property takes a comma-separated list in quotation marks, in preference order, and if it is undefined or empty the JDK defaults apply. Because it is a -D flag, the change applies to every JSSE connection made by that process without touching source code. The operator who controls the launch command controls the setting. The JSSE Reference Guide for JDK 27 gives the example value jdk.tls.namedGroups="X25519MLKEM768,secp521r1,secp256r1,ffdhe2048".

  • Flag form: pass -Djdk.tls.namedGroups="..." on the java command line, with quotation marks around any value containing spaces.
  • Scope: the setting covers all TLS connections in that JVM, including ones the application does not own.
  • Default behavior: on JDK 27, X25519MLKEM768 is enabled and preferred, and a client sends an X25519MLKEM768 and an x25519 key share by default.
  • Verification: run with -Djavax.net.debug=ssl:handshake and read the key_share in the ServerHello for the negotiated named group.
  • Not stated in the sources: how packaged launchers, container entrypoints or application servers pass JVM flags. Check the launch script or image definition for the actual java invocation.

Confirm the exact command line the service runs, then confirm the negotiated group in the handshake debug output before and after the change.

Decision path from handshake error to named group fix

The path starts at a TLS handshake failure in a Java client or server, then moves to checking the negotiated group with -Djavax.net.debug=ssl:handshake and reading the key_share extension in the ServerHello. From there the reader chooses between the -Djdk.tls.namedGroups command-line property, which applies to the whole JVM, and SSLParameters.setNamedGroups in code, which applies to one connection. The last step is restarting the application and repeating the handshake check to confirm the peer now agrees on a group.

Decision path from a Java handshake failure to a named group setting and retest.

How to confirm the Java TLS fix worked

Confirm the fix by rerunning the failing connection with -Djavax.net.debug=ssl:handshake and reading the key_share extension in the ServerHello. The debug output names the group the server selected in its "named group" field. If you changed jdk.tls.namedGroups or the SSLParameters list, check that the group shown there is one you intended, for example a traditional group such as x25519 or secp256r1 when you have chosen to prefer classic key exchange. If the output shows X25519MLKEM768 on a JDK that offers it by default, the hybrid group was negotiated. Run java -version first so you know which JDK actually ran the application, because the default group ordering differs by update, and the JEP 527 defaults apply in JDK 27 and from JDK 25.0.5 onward.

A handshake that gets as far as the debug output is not enough on its own. Confirm that the connection completes, meaning the application receives its response and the TLS session is established without a fatal alert or an exception from the client. The Kroxylicious project describes the failure mode you are fixing as a client that fails to connect because there is no group in common with the peer, so a successful run should show the client finishing the handshake and sending its request. Run the check against the same server and network path that failed before, since that is where the error appeared. If the group you expected does not show up, the peer may not support it, and the fix may need a different entry in the list rather than a further change to the client.

After the change, watch for failures on other peers. A setting that restores one service can still break another, because each server may negotiate groups differently and some middleboxes handle a larger ClientHello poorly. The Palantir dialogue project reported that clients which reached services before a JDK upgrade began failing against some servers and middleboxes after it, which is why the same test should be repeated against each peer your application uses. Keep the debug option out of production logs once you have finished, since handshake tracing is verbose. If you are unsure whether a peer is affected, ask the owner of that service which TLS groups it accepts before rolling the change out widely.

What can break after changing Java named groups

Changing the jdk.tls.namedGroups list or the default ordering alters which key exchange a Java client offers first, and that change can affect peers, round trips and compliance settings. Each card below covers one place where a change can break a connection, with the check to run before and after the change.

Removing the hybrid group for a peer

Dropping X25519MLKEM768 from the list stops the client from offering a hybrid key exchange, which is the fix when a peer cannot handle it. The trade-off is that any connection that relied on the hybrid group will now negotiate a classic group, so it no longer gets the post-quantum key exchange. Before removing it, confirm which peers need the change and record that they are expected to fall back. After the change, check the key_share in the ServerHello with -Djavax.net.debug=ssl:handshake to confirm the negotiated group.

JSSE Reference Guide

Extra round trip from HelloRetryRequest

When the hybrid group is moved to the end of the list, as Palantir's dialogue release 6.49.0 does, the client starts with X25519. A server that requires the hybrid group must send a HelloRetryRequest, which adds one round trip to the handshake. This matters most for latency-sensitive services and for many short connections. Measure handshake time before and after the reorder, and confirm the reordering applies only on JDK 20 and later.

Palantir dialogue PR

Pinned and tested configurations

A jdk.tls.namedGroups value set in a startup script, container image or code path can drift from what was tested, especially after a JDK upgrade changes the default. Check every place the list is set, including command-line flags and SSLParameters.setNamedGroups calls, and compare them with the configuration that was tested. Re-run the connection tests against each peer after any change, because a pinned list that worked on one JDK may behave differently on another.

Disabling groups in compliance-mode environments

In regulated or compliance-mode environments, removing a group changes the cryptography the system is documented to use, and that change may need review by the security or compliance team. Record the group list in use, the reason for each change, and the approval. Ask the team which control or policy governs the list, and confirm the change matches it before deploying. Do not treat a change in the list as a routine setting update without that review.

Failures when no group is shared

If the client and server share no group, the connection fails. Kroxylicious describes this case as a client that fails to connect when there is no group in common, and the sources listed on this page do not give an exception text for it. Look for handshake failures in the client logs after a list change, and check that the server supports at least one group in the client's list. Test each peer after the change rather than assuming the default covers it.

Kroxylicious blog

When to get help with a Java post-quantum TLS error

Some Java TLS failures on a hybrid group are better handled with outside help than by changing settings alone. The first case is when your team cannot change the peer. If the failing server belongs to a vendor, a partner or another internal team, you cannot adjust its key exchange configuration yourself. In that situation, do not use jdk.tls.namedGroups to hide the problem on your side indefinitely. Document the exact group the peer supports, the JDK version you run and the error you saw, then take that record to the owner of the server and ask whether they plan to offer a hybrid group. The Palantir dialogue report shows that the failure can come from middleboxes and servers that cannot read a split ClientHello, so the owner may need to check their network path as well.

The second case is scale. If many services, hosts or JVM builds show the same failure after a JDK upgrade, escalate to platform or security engineering rather than patching each application one at a time. A consistent group list set through a shared launch configuration or a common SSLParameters helper is far easier to audit than dozens of ad hoc overrides. Also escalate when the JVM is vendor-packaged, because the default group behavior you see depends on the build you actually run. Confirm the exact version with java -version on each host, and ask your JDK vendor or distribution maintainer which release notes apply to their build. The sources do not describe vendor support terms for these changes, so ask your vendor directly what they commit to and on what timeline.

The third case is a regulated environment that needs evidence of the change. Auditors and internal risk reviewers will likely ask what was changed, when, on which hosts and how it was verified. Keep the -Djavax.net.debug=ssl:handshake output that shows the negotiated group, the configuration source, and the test results for each environment. Route the evidence request to your compliance and security owners early, and ask an independent assessor to confirm what counts as sufficient for your framework. DeployOpen can help with the testing and documentation side of this work, and independent auditors and certification bodies make the final determination.

What Java teams ask after a post-quantum TLS error

Is the connection still encrypted when a post-quantum TLS handshake fails?

A failed handshake means no encrypted session is established, so no application data is sent over that connection. The error stops the connection rather than downgrading it silently in most cases, but Java applications that retry or catch exceptions can leave a service unreachable without any encrypted traffic flowing. Check the application logs and the handshake trace with -Djavax.net.debug=ssl:handshake to see whether the failure happened before the key exchange completed. Confirm the exact behavior of your Java version and your load balancer in their documentation, since the sources for this page do not describe every fallback path.

Is a post-quantum TLS error in Java urgent to fix?

Treat it as urgent when the error breaks a service that other systems depend on, because the failure blocks connections that worked before the upgrade. The error itself does not show that the data is exposed. The JDK 25.0.5 release notes and the JDK 27 guide make X25519MLKEM768 the default preferred group, so any Java application upgraded to those versions can hit the problem without changing its own code. Plan the fix by how many clients and services are affected, and confirm the scope with your own inventory rather than assuming it from this page.

Can I silence or ignore a post-quantum TLS warning in Java?

You can use a temporary configuration that removes the hybrid group while you prepare the real change, but treat it as a stopgap rather than a fix. The jdk.tls.namedGroups system property accepts a list of groups in preference order, so omitting X25519MLKEM768 keeps the connection working on classic key exchange for now. Record the change, set a date to revisit it, and remove the override once the peer supports the hybrid group. Do not leave the override in place as the permanent configuration without a documented reason.

Why does a TLS connection fail after a JDK upgrade?

The JDK 27 release and JDK 25 from update 25.0.5 enable the hybrid group X25519MLKEM768 by default and prefer it first. A client that now sends that key share can fail to connect to servers or middleboxes that do not handle the larger ClientHello or do not share any group with it. The Palantir dialogue project reported that a larger ClientHello split across TCP segments caused some servers and middleboxes to fail the handshake instead of falling back. Compare your java -version output before and after the upgrade to confirm the version change, then run a handshake trace to see which group was offered.

What can I do if I cannot upgrade the JDK right away?

Keep the upgrade on hold and reorder or restrict the named groups in the application instead. Set jdk.tls.namedGroups with -D on the java command line, placing the classic groups first, or call SSLParameters.setNamedGroups in code and apply it with setSSLParameters. The Palantir project moved X25519MLKEM768 to the end of the list so connections start with X25519, and a server that requires the hybrid group can request it through a HelloRetryRequest, which adds one round trip. Test each change against the affected peers before rolling it out widely.

How do I confirm which key exchange group Java negotiated?

Run the application with -Djavax.net.debug=ssl:handshake and read the key_share extension in the ServerHello, which names the group the server selected. A group name of X25519MLKEM768 means the hybrid group was negotiated, and x25519 or another classic group means it was not. Use java -Djavax.net.debug=help MyApp first if you need the list of debug options, since that command prints the options and exits without running the application. Save the trace output for the change record.

Should I bring in an outside team to fix a Java TLS error?

Bring in outside help when the failure affects production services, spans several vendors or middleboxes, or your team cannot reproduce the handshake trace. A fixed-scope engagement can cover the inventory of affected services, the named-group configuration, the test plan and the retest, with the scope and deliverables agreed in writing before work starts. DeployOpen implements, hardens and documents self-hosted platforms inside the client's own infrastructure, and it does not issue audit reports or certifications. Ask any provider for a written scope and a quote based on it, and ask which versions and components their work covers.

What drives the cost of fixing a post-quantum TLS error in Java?

The cost depends on how many services use Java, how many peers and middleboxes must be tested, and whether the fix is a configuration change or a code change across several applications. A one-time review is separate from any recurring testing or upgrade support. The sources for this page do not give a price or effort estimate, so ask any provider for a quote that lists the services in scope, the test environments needed, and whether ongoing retesting is included. Compare quotes on the same written scope.

How DeployOpen works on this

DeployOpen works through Java TLS hybrid key exchange failures as a fixed-scope engagement inside your own infrastructure. We first identify which JDK builds your services run, where the handshake fails, and which peers and middleboxes are involved, then change the named groups configuration and verify the negotiated group before handover.

How we scope

  • We confirm the JDK versions in use, including whether services run JDK 25.0.5 or later or JDK 27, where X25519MLKEM768 is on by default.
  • We list the services and peers that have stopped connecting, and record the failing handshake and the host or middlebox that sits between them.
  • The written scope states which applications, which named groups configuration and which test environments are covered, before work begins.

How we build

  • We set the jdk.tls.namedGroups property or SSLParameters.setNamedGroups in each affected application, keeping the preference order your peers can support.
  • We enable the -Djavax.net.debug=ssl:handshake output in a test environment and read the key_share in the ServerHello to confirm the group that was negotiated.
  • Where a service has to keep the traditional default ordering, we document the dialogue opt-out flag and when it is read, at JVM startup.

How we hand over

  • You receive the changed configuration, the exact java command line or code change, and the java -version output recorded for each build tested.
  • The handover includes the handshake debug results showing the negotiated group for each peer, so your team can repeat the check later.
  • Each change is documented with the reason it was made and the rollback steps, so an operator can reverse it without a DeployOpen engineer.

How we support

  • Ongoing support, JDK upgrades and continuous testing are available as a retainer, covering the named groups settings as new JDK updates ship.
  • Retesting follows any JDK upgrade or change to a peer, server or middlebox, so a fallback that worked before is checked again.
  • Questions about the Java version, the handshake output or the vendor's documentation are answered against the written scope before any new work starts.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.