SslCipherList.java - SSL Cipher List

Q

How to get a list of SSL ciphers supported in jsse.jar?

✍: FYIcenter

A

You can use the following sample Java code to a list of SSL ciphers supported in jsse.jar:

// Copyright (c) FYIcenter.com
import java.net.*;
import java.io.*;
import javax.net.ssl.*;

public class SslCipherList {
   public static void main(String[] args) throws Exception {
      SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
      SSLServerSocket socket = (SSLServerSocket)factory.createServerSocket(443);

      String [] cipherSuites = socket.getEnabledCipherSuites();
      System.out.println("List of SSL ciphers supported:");
      for (int i = 0; i < cipherSuites.length; i++) {
         System.out.println("   " + i + ": " + cipherSuites[i]);
      }
      socket.close();
   }
}

You can compile and run the above example in a command window:

\fyicenter>\local\jdk-1.8.0\bin\javac SslCipherList.java

\fyicenter>\local\jdk-1.8.0\bin\java SslCipherList

List of SSL ciphers supported:
   0: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
   1: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
   2: TLS_RSA_WITH_AES_128_CBC_SHA256
   3: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
   4: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
   5: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
   6: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
   7: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
   8: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
   9: TLS_RSA_WITH_AES_128_CBC_SHA
   10: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
   11: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
   12: TLS_DHE_RSA_WITH_AES_128_CBC_SHA
   13: TLS_DHE_DSS_WITH_AES_128_CBC_SHA
   14: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
   15: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
   16: TLS_RSA_WITH_AES_128_GCM_SHA256
   17: TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
   18: TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
   19: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
   20: TLS_DHE_DSS_WITH_AES_128_GCM_SHA256
   21: TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
   22: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
   23: SSL_RSA_WITH_3DES_EDE_CBC_SHA
   24: TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
   25: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
   26: SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
   27: SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
   28: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
   29: TLS_ECDHE_RSA_WITH_RC4_128_SHA
   30: SSL_RSA_WITH_RC4_128_SHA
   31: TLS_ECDH_ECDSA_WITH_RC4_128_SHA
   32: TLS_ECDH_RSA_WITH_RC4_128_SHA
   33: SSL_RSA_WITH_RC4_128_MD5
   34: TLS_EMPTY_RENEGOTIATION_INFO_SCSV

 

Examples for jsse.jar - Java Secure Socket Extension

⇒⇒FAQ for jsse.jar - Java Secure Socket Extension

2018-03-31, 488👍, 0💬