Home » Java » Core Java » Security Enhancements in JDK 9, 10 and 11

About Martin Toshev

Martin Toshev

Security Enhancements in JDK 9, 10 and 11

One of reasons for shorter release cycles of the JDK is possibility to rollout faster security bugfixes and enhancements. In this article we will review in a nutshell what are the major security enhancements introduced in latest JDK versions. As most of these enhancements are related to TLS it is essential to understand the TLS handshake process as illustrated by the following diagram:

Security Enhancements


Major security enhancements introduced in JDK 9 are related to the TLS support provided by JSSE (Java Secure Socket Extension) API. These include:
• DTLS support in JDK 9: DTLS provides is essentially TLS over UDP so that you can encrypt communication established by unreliable protocols running over UDP
SSLContext sslContext = SSLContext.getInstance("DTLS");
SSLEngine engine = sslContext.createSSLEngine();
engine.setUseClientMode(…); // true or false depending on whether it is a DTLS client or server

• TLS ALPN extension in JDK 9: provides support for negotiating the application protocol during the TLS handshake process, the list of acceptable protocols is set as a simple list of strings on both the TLS client and TLS server

SSLParameters sslParams = sslSocket.getSSLParameters();

or (for non-blocking mode of operation)

SSLParameters sslParams = sslEngine.getSSLParameters();

or (using more complex logic to determine the negotiated protocol)

sslSocket.setHandshakeApplicationProtocolSelector((serverSocket, clientProtocols) {
SSLSession handshakeSession = serverSocket.getHandshakeSession();
String cipher = handshakeSession.getCipherSuite();
int packetBufferSize = handshakeSession.getPacketBufferSize();
if("RC4".equals(cipher) && packetBufferSize > 1024) {
return "protocol1";
} else {
return "protocol2";

TLS ALPN comes in handy i.e. for web servers that support both the HTTP 1.1 and HTTP 2.0 protocols over TLS for their clients
• OCSP Stapling for TCP: provides a mechanism for doing certificate revocation checking on the TLS server rather than the TLS client thus saving network bandwidth, must be enabled on both the TLS client and the TLS server


and (on the TLS server)


• PKCS12 keystores by default (so far these were JKS, but those are not portable across different than Java programming languages)
• DRBG-Based SecureRandom Implementations
• Utilization of CPU Instructions for GHASH and RSA
• SHA-1 Certificates disabled for certificate validation
• Implementation of the SHA-3 hash algorithms

JDK 10

There are two main enhancements introduced in JDK 10:
JEP 319 Root Certificates: a list or root certificates has been exposed to the cacerts keystore of the JDK
Some security-related APIs marked for removal: some

JDK 11

The major security enhancement introduced in JDK 11 is provided by JEP 332: Transport Layer Security (TLS) 1.3. This is the new version of the TLS protocol that provides a number of enhancements over the previous (1.2) version of the TLS specification. In addition more enhancements are made to the root certificates in the cacerts keystore (some root certificates are added and some removed).

Published on Java Code Geeks with permission by Martin Toshev, partner at our JCG program. See the original article here: Security Enhancements in JDK 9, 10 and 11

Opinions expressed by Java Code Geeks contributors are their own.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Leave a Reply


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Notify of