Skip to content

JVM debugging

  • troubleshooting

Network, TLS handshake, cert chain, session resumption. Useful for “the connection just hangs / fails” diagnostics, very noisy:

Terminal window
JAVA_OPTS="$JAVA_OPTS -Djavax.net.debug=all"

Most of the time you only want the handshake — much less noise:

Terminal window
JAVA_OPTS="$JAVA_OPTS -Djavax.net.debug=ssl:handshake:verbose"

When the handshake fails on a modern JDK (TLS 1.3 by default):

Terminal window
# Force TLS 1.2 only — quickly rules out a 1.3-specific issue.
-Djdk.tls.client.protocols=TLSv1.2
# Restrict the curves offered in the ClientHello (some middleboxes drop
# unexpected curves). Default in JDK 21+ includes x25519, secp256r1, etc.
-Djdk.tls.namedGroups="secp256r1,secp384r1"

The disabled-algorithm list lives in $JAVA_HOME/conf/security/java.security under jdk.tls.disabledAlgorithms. Read it before overriding so you know what you are re-enabling.

tls-override.properties
jdk.tls.disabledAlgorithms=
Terminal window
java -Djava.security.properties=tls-override.properties -jar app.jar

One = merges the file over java.security, overriding only the properties you list. Two (-Djava.security.properties==...) discard the master file entirely — almost never what you want, since it drops every other security default with it.

This is for one-off diagnostics only. Do not ship it.