You did not specify the Java version, because below Java 8 there is no way to prohibit or disable a specific SSL protocol, but in Java 8 you can set the allowed protocols, for example, the following
Statically:
% java -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" MyApp
Dynamically:
java.lang.System.setProperty("jdk.tls.client.protocols", "TLSv1,TLSv1.1,TLSv1.2");
If you are still using java 7 or lower, try using the described work Instructions for disabling SSL v3.0 in Oracle JDK and JRE
I just implemented the following code snippet to disable SSLv3 and SSLv2Hello in one of our Java6 applications.
if(disabledSSLProtocols != null) { String[] protocols = sslEngine.getEnabledProtocols(); List<String> protocolList = new ArrayList<String>(); for (String s : protocols) { if (disabledSSLProtocols.contains(s)) { log4j.info("{} protocol is disabled", s); continue; } log4j.info("{} protocol is enabled", s); protocolList.add(s); } sslEngine.setEnabledProtocols(protocolList.toArray(new String[0])); }
Where disabledSSLProtocols initialized with SSLv3,SSLv2Hello
Mubashar ahmad
source share