hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1528736 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
Date Thu, 03 Oct 2013 07:43:48 GMT
Author: olegk
Date: Thu Oct  3 07:43:47 2013
New Revision: 1528736

URL: http://svn.apache.org/r1528736
Log:
Fixed initialization of SSL supported protocols and cipher suites

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java?rev=1528736&r1=1528735&r2=1528736&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
Thu Oct  3 07:43:47 2013
@@ -35,6 +35,7 @@ import java.util.LinkedList;
 import java.util.List;
 
 import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
 
 import org.apache.http.ConnectionReuseStrategy;
 import org.apache.http.Header;
@@ -699,19 +700,22 @@ public class HttpClientBuilder {
         if (connManager == null) {
             LayeredConnectionSocketFactory sslSocketFactory = this.sslSocketFactory;
             if (sslSocketFactory == null) {
+                final String[] supportedProtocols = systemProperties ? split(
+                        System.getProperty("https.protocols")) : null;
+                final String[] supportedCipherSuites = systemProperties ? split(
+                        System.getProperty("https.cipherSuites")) : null;
                 X509HostnameVerifier hostnameVerifier = this.hostnameVerifier;
                 if (hostnameVerifier == null) {
                     hostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
                 }
                 if (sslcontext != null) {
-                    sslSocketFactory = new SSLConnectionSocketFactory(sslcontext, hostnameVerifier);
+                    sslSocketFactory = new SSLConnectionSocketFactory(
+                            sslcontext, supportedProtocols, supportedCipherSuites, hostnameVerifier);
                 } else {
                     if (systemProperties) {
                         sslSocketFactory = new SSLConnectionSocketFactory(
-                                (javax.net.ssl.SSLSocketFactory) javax.net.ssl.SSLSocketFactory.getDefault(),
-                                split(System.getProperty("https.protocols")),
-                                split(System.getProperty("https.cipherSuites")),
-                                hostnameVerifier);
+                                (SSLSocketFactory) SSLSocketFactory.getDefault(),
+                                supportedProtocols, supportedCipherSuites, hostnameVerifier);
                     } else {
                         sslSocketFactory = new SSLConnectionSocketFactory(
                                 SSLContexts.createDefault(),



Mime
View raw message