Which security protocols are enabled in a specific Java Release bundle

Question: What security protocols are enabled in a specific Java Release Bundle?  For example:

zulu8.50.0.51 build jdk1.8.0_275-b01

 

Answer: 

Zulu 8.50.0.51 is an OpenJDK 8 release of 1.8.0_275.  

Officially OpenJDK 1.8.0_275 implements the following protocols:

  • SSLv2Hello
  • SSLv3
  • TLSv1
  • TLSv1.1
  • TLSv1.2

To check the security protocols enabled in any Java release, you can use the following "ProtocolTest.java" code (also attached).

import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLContext;
import javax.net.SocketFactory;
import javax.net.ssl.SSLSocketFactory;

public class ProtocolTest {

public static void main(String[] args) throws Exception {

SSLContext context = SSLContext.getInstance("TLS"); context.init(null,null,null);
SSLSocketFactory factory = (SSLSocketFactory)context.getSocketFactory();
SSLSocket socket = (SSLSocket)factory.createSocket();
String[] protocols = socket.getSupportedProtocols();
System.out.println("Supported Protocols: " + protocols.length);
for(int i = 0; i < protocols.length; i++) {
System.out.println(" " + protocols[i]);
}
}
}

Notice that in this particular implementation of Java version 1.8.0_275, we support the additional protocol TLSv1.3.

For example:

$ java -version
zulu8.50.0.51 build jdk1.8.0_275-b01
$ javac ProtocolTest.java

$ java ProtocolTest
Supported Protocols: 6
TLSv1.3
TLSv1.2
TLSv1.1
TLSv1
SSLv3
SSLv2Hello

Add Comment

Comments

0 comments

Please sign in to leave a comment.

Was this article helpful?
0 out of 0 found this helpful