HTTPCLIENT-1595: respect SSL protocols disabled by default by the provider
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1650758 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a0dee0cb50
commit
bc2b4930bd
|
@ -370,14 +370,16 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
|
|||
sslsock.setEnabledProtocols(supportedProtocols);
|
||||
} else {
|
||||
// If supported protocols are not explicitly set, remove all SSL protocol versions
|
||||
final String[] allProtocols = sslsock.getSupportedProtocols();
|
||||
final String[] allProtocols = sslsock.getEnabledProtocols();
|
||||
final List<String> enabledProtocols = new ArrayList<String>(allProtocols.length);
|
||||
for (String protocol: allProtocols) {
|
||||
if (!protocol.startsWith("SSL")) {
|
||||
enabledProtocols.add(protocol);
|
||||
}
|
||||
}
|
||||
sslsock.setEnabledProtocols(enabledProtocols.toArray(new String[enabledProtocols.size()]));
|
||||
if (!enabledProtocols.isEmpty()) {
|
||||
sslsock.setEnabledProtocols(enabledProtocols.toArray(new String[enabledProtocols.size()]));
|
||||
}
|
||||
}
|
||||
if (supportedCipherSuites != null) {
|
||||
sslsock.setEnabledCipherSuites(supportedCipherSuites);
|
||||
|
|
Loading…
Reference in New Issue