hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r604462 - /jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
Date Sat, 15 Dec 2007 17:46:46 GMT
Author: olegk
Date: Sat Dec 15 09:46:43 2007
New Revision: 604462

URL: http://svn.apache.org/viewvc?rev=604462&view=rev
Log:
HTTPCLIENT-718: SSL verification occurs before setSoTimeout, which can lead to hangs

Modified:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java?rev=604462&r1=604461&r2=604462&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
Sat Dec 15 09:46:43 2007
@@ -289,9 +289,11 @@
             sslock.bind(isa);
         }
 
-        int timeout = HttpConnectionParams.getConnectionTimeout(params);
-        sslock.connect(target, timeout);
+        int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
+        int soTimeout = HttpConnectionParams.getSoTimeout(params);
 
+        sslock.connect(target, connTimeout);
+        sslock.setSoTimeout(soTimeout);
         try {
             hostnameVerifier.verify(host, sslock);
             // verifyHostName() didn't blowup - good!



Mime
View raw message