// Strip "SSLv3" from the current enabled protocols. String[] protocols = sslSocket.getEnabledProtocols(); Set<String> set = new HashSet<>(); for (String s : protocols) { if (s.equals("SSLv3") || s.equals("SSLv2Hello")) { continue; } set.add(s); } sslSocket.setEnabledProtocols(set.toArray(new String[0]));