ESGF/esgf-getcert — pull request #4 by kterry (2014-11-04 17:20:22+00:00)
Title: Avoid SSLHandshakeException in JVM's < 7

If SSLHandshakeException is raised, SSLv3 and SSLv2Hello protocols are removed and then retry the
connection.

The idea comes from: http://www.oracle.com/technetwork/java/javase/documentation/cve-2014-3566-2342133.html. Specifically from this part:

- To dynamically remove SSLv3 from the list of enabled protocols, use the following code snippet:
SSLSocket sslSocket = sslSocketFactory.createSocket(...);

// Strip "SSLv3" from the current enabled protocols.
String[] protocols = sslSocket.getEnabledProtocols();
Set 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]));