Last active
August 29, 2015 14:08
-
-
Save ggrandes/19e3b72d49cb1a563cb0 to your computer and use it in GitHub Desktop.
Show supported Java procotols an cipher suites for SSL / TLS
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 javax.net.ssl.SSLContext; | |
import javax.net.ssl.SSLParameters; | |
import java.security.Provider; | |
import java.security.Security; | |
public class SSLSupport { | |
public static void main(String[] args) throws Throwable { | |
try { | |
final String bcName = "org.bouncycastle.jce.provider.BouncyCastleProvider"; | |
Security.addProvider((Provider) Class.forName(bcName).newInstance()); | |
} catch (Throwable t) { | |
System.out.println("Unable to register BouncyCastleProvider: " + t.toString()); | |
} | |
SSLContext ctx = SSLContext.getDefault(); | |
SSLParameters sslParams = ctx.getSupportedSSLParameters(); | |
System.out.println("### Protocols ###"); | |
for (String proto : sslParams.getProtocols()) { | |
System.out.println(proto); | |
} | |
System.out.println("### CipherSuites ###"); | |
for (String suite : sslParams.getCipherSuites()) { | |
System.out.println(suite); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment