hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1650760 - /httpcomponents/httpclient-android/branches/4.3.5-android/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java
Date Sat, 10 Jan 2015 15:54:14 GMT
Author: olegk
Date: Sat Jan 10 15:54:13 2015
New Revision: 1650760

URL: http://svn.apache.org/r1650760
Log:
Respect SSL protocols disabled by default by the provider

Modified:
    httpcomponents/httpclient-android/branches/4.3.5-android/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java

Modified: httpcomponents/httpclient-android/branches/4.3.5-android/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.5-android/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java?rev=1650760&r1=1650759&r2=1650760&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.5-android/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java
(original)
+++ httpcomponents/httpclient-android/branches/4.3.5-android/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java
Sat Jan 10 15:54:13 2015
@@ -297,14 +297,16 @@ public class SSLConnectionSocketFactory
             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);



Mime
View raw message