Skip to content

Instantly share code, notes, and snippets.

@lanimall
Created April 13, 2015 17:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save lanimall/cb7d84c8d6c6301d4d0c to your computer and use it in GitHub Desktop.
Save lanimall/cb7d84c8d6c6301d4d0c to your computer and use it in GitHub Desktop.
SSL Protocol Tests - Default
public class SSLProtocolTests {
public static void main(String[] args) throws Exception {
SSLContext context = SSLContext.getDefault();
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]);
}
protocols = socket.getEnabledProtocols();
System.out.println("Enabled Protocols: " + protocols.length);
for(int i = 0; i < protocols.length; i++)
{
System.out.println(" " + protocols[i]);
}
String[] ciphers = socket.getSupportedCipherSuites();
System.out.println("Enabled Ciphers: " + ciphers.length);
for(int i = 0; i < ciphers.length; i++)
{
System.out.println(" " + ciphers[i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment