hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1625684 - in /httpcomponents/httpclient-android/branches/4.3.5-android: RELEASE_NOTES.txt src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java
Date Wed, 17 Sep 2014 17:06:33 GMT
Author: olegk
Date: Wed Sep 17 17:06:32 2014
New Revision: 1625684

URL: http://svn.apache.org/r1625684
Log:
HTTPCLIENT-1555: SSL handshake timeout is always zero (infinite)

Modified:
    httpcomponents/httpclient-android/branches/4.3.5-android/RELEASE_NOTES.txt
    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/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.5-android/RELEASE_NOTES.txt?rev=1625684&r1=1625683&r2=1625684&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.5-android/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient-android/branches/4.3.5-android/RELEASE_NOTES.txt Wed Sep 17
17:06:32 2014
@@ -1,6 +1,9 @@
 Changes since 4.3.5
 -------------------
 
+* [HTTPCLIENT-1555] SSL handshake timeout is always zero (infinite).
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCLIENT-1553] Fixed IllegalArgumentException in HttpClientBuilder.build() if system
   properties are not used.
   Contributed by Oleg Kalnichevski <olegk at apache.org>

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=1625684&r1=1625683&r2=1625684&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
Wed Sep 17 17:06:32 2014
@@ -146,7 +146,7 @@ public class SSLConnectionSocketFactory 
      */
     public static SSLConnectionSocketFactory getSocketFactory() throws SSLInitializationException
{
         return new SSLConnectionSocketFactory(
-            (javax.net.ssl.SSLSocketFactory) SSLCertificateSocketFactory.getDefault(0),
+            (javax.net.ssl.SSLSocketFactory) SSLCertificateSocketFactory.getDefault(-1),
             BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
     }
 
@@ -168,7 +168,7 @@ public class SSLConnectionSocketFactory 
      */
     public static SSLConnectionSocketFactory getSystemSocketFactory() throws SSLInitializationException
{
         return new SSLConnectionSocketFactory(
-            (javax.net.ssl.SSLSocketFactory) SSLCertificateSocketFactory.getDefault(0),
+            (javax.net.ssl.SSLSocketFactory) SSLCertificateSocketFactory.getDefault(-1),
             split(System.getProperty("https.protocols")),
             split(System.getProperty("https.cipherSuites")),
             BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
@@ -243,6 +243,9 @@ public class SSLConnectionSocketFactory 
             sock.bind(localAddress);
         }
         try {
+            if (connectTimeout > 0 && sock.getSoTimeout() == 0) {
+                sock.setSoTimeout(connectTimeout);
+            }
             sock.connect(remoteAddress, connectTimeout);
         } catch (final IOException ex) {
             try {



Mime
View raw message