jdk.tls.server.newSessionTicketCount Java System Property accepts an integer from 0 to 10, allowing control over the number of TLSv1.3 resumption tickets returned by a java server.The default value of jdk.tls.server.newSessionTicketCount is 1, meaning a java server will only send one session resumption ticket to the client by default.
You can set this property to an integer value between 0 and 10. Setting to zero would prevent session resumption because no tickets are sent, and setting to 10 would return ten session resumption tickets.
TLS 1.2 does not support more than one session ticket, however it will send zero resumption tickets if this property is set to zero.
jdk.tls.server.newSessionTicketCount ExplainedTLS Session resumption lets a client and server skip the expensive full handshake (with its certificate exchange and key agreement) by reusing keying material from a previous connection. In TLS 1.3, this is done exclusively via PSK (Pre-Shared Key) mode, and tickets are the primary way servers distribute those PSKs.
The jdk.tls.server.newSessionTicketCount system property controls how many resumption tickets a java TLS 1.3 server will respond with. It is not uncommon for servers to return multiple tickets, because a client should only use each ticket once.
Here are some other networking Java system properties:
http.agenthttp.keepAlivehttp.maxConnectionshttps.protocolsjava.net.preferIPv4Stackjava.net.preferIPv6Addressesjava.net.useSystemProxiesjavax.net.debugjavax.net.ssl.trustStorejdk.http.maxHeaderSizejdk.net.hosts.filejdk.tls.client.protocolsjdk.crypto.disabledAlgorithmsjdk.tls.disabledAlgorithmsnetworkaddress.cache.negative.ttlnetworkaddress.cache.ttlsun.net.client.defaultConnectTimeoutsun.net.client.defaultReadTimeoutsun.net.inetaddr.ttlJava has supported the jdk.tls.server.newSessionTicketCount system property since Java 24+ or Java 21.0.11, and 17.0.19 - possible unsupported in earlier versions.
jdk.tls.server.newSessionTicketCount on StartupYou can set the jdk.tls.server.newSessionTicketCount java system property during startup of the java runtime using the -D command line argument:
java -Djdk.tls.server.newSessionTicketCount=3 MyAppMain
You may also be able to specify jdk.tls.server.newSessionTicketCount via the JAVA_TOOL_OPTIONS environment variable:
JAVA_TOOL_OPTIONS=-Djdk.tls.server.newSessionTicketCount=3
jdk.tls.server.newSessionTicketCount at RuntimeYou can set jdk.tls.server.newSessionTicketCount at runtime with the following Java code:
System.setProperty("jdk.tls.server.newSessionTicketCount", "3");
WARNING: Depending on the property and JVM version using
setPropertymay or may not work if the JDK Java class that uses this variable has already been loaded. The value of the jdk.tls.server.newSessionTicketCount system property may be cached within an internal private static variable of the implementing class.
To read the value of jdk.tls.server.newSessionTicketCount at runtime, you can use this Java code:
String propertyValue = System.getProperty("jdk.tls.server.newSessionTicketCount");
if (propertyValue != null) {
System.out.println("jdk.tls.server.newSessionTicketCount = " + propertyValue);
} else {
System.out.println("jdk.tls.server.newSessionTicketCount was null");
}