Created
April 19, 2019 10:02
-
-
Save shalk/6c80daa4b9042d726990680ac3b93e18 to your computer and use it in GitHub Desktop.
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
//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]); | |
} | |
} | |
} |
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