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
This commit is contained in:
Oleg Kalnichevski 2007-12-15 17:46:43 +00:00
parent 2370dc5fd3
commit f696e1f684
1 changed files with 4 additions and 2 deletions

View File

@ -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!