-
-
Save duleitony/92882ce8f5ed16cf8b772d24cd45ffcd to your computer and use it in GitHub Desktop.
SSL Protocol Tests - TLSv1.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SSLProtocolTests { | |
public static void main(String[] args) throws Exception { | |
SSLContext context = SSLContext.getInstance("TLSv1.2"); | |
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]); | |
} | |
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