Skip to content

Instantly share code, notes, and snippets.

@shalk
Created April 19, 2019 10:02
Show Gist options
  • Save shalk/6c80daa4b9042d726990680ac3b93e18 to your computer and use it in GitHub Desktop.
Save shalk/6c80daa4b9042d726990680ac3b93e18 to your computer and use it in GitHub Desktop.
//import org.apache.http.conn.ssl.SSLSocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
public class Test {
public static void main(String[] args) throws Exception {
SSLContext context = SSLContext.getInstance("TLS");
context.init(null, null, null);
SSLSocketFactory factory = 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]);
}
}
}
@shalk
Copy link
Author

shalk commented Apr 19, 2019

/opt/soft/jdk1.8.0/bin/
/opt/soft/openjdk8u202-b08/bin/
/opt/soft/jdk1.7.0_60/bin/
/opt/soft/jdk1.8.0_144/bin/
/opt/soft/jdk1.6.0_37/bin/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment