From f696e1f6849b4d4d9195ec7084f87e5ab9195e80 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Sat, 15 Dec 2007 17:46:43 +0000 Subject: [PATCH] HTTPCLIENT-718: SSL verification occurs before setSoTimeout, which can lead to hangs git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@604462 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/http/conn/ssl/SSLSocketFactory.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java b/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java index 060182707..b9fec69ae 100644 --- a/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java +++ b/module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java @@ -289,9 +289,11 @@ public class SSLSocketFactory implements LayeredSocketFactory { 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!