Skip to content

Instantly share code, notes, and snippets.

@kaicode
Created May 10, 2021 11:43
Show Gist options
  • Save kaicode/8039bd755a4c66c586180422146d016b to your computer and use it in GitHub Desktop.
Save kaicode/8039bd755a4c66c586180422146d016b to your computer and use it in GitHub Desktop.
Java class to print supported SSL protocols
import javax.net.ssl.SSLContext;
public class PrintSSLProtocols {
public static void main(String[] args) throws Exception {
System.out.println(String.join(" ", SSLContext.getDefault().getSupportedSSLParameters().getProtocols()));
}
}
@kaicode
Copy link
Author

kaicode commented May 10, 2021

Usage:

wget "https://gist.githubusercontent.com/kaicode/8039bd755a4c66c586180422146d016b/raw/85393549144911b10e429ee7919ce54c7dc47b8f/PrintSSLProtocols.java"
javac PrintSSLProtocols.java
java PrintSSLProtocols

Example output:

$ java PrintSSLProtocols 
TLSv1.3 TLSv1.2 TLSv1.1 TLSv1 SSLv3 SSLv2Hello

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