Use non-zero connect timeout as SSL handshake handshake (socket) timeout if not explicitly set by the caller (socket timeout is zero)

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1626782 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2014-09-22 14:10:17 +00:00
parent 04337ec994
commit 1d09a8308f
1 changed files with 3 additions and 0 deletions

View File

@ -320,6 +320,9 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
sock.bind(localAddress);
}
try {
if (connectTimeout > 0 && sock.getSoTimeout() == 0) {
sock.setSoTimeout(connectTimeout);
}
sock.connect(remoteAddress, connectTimeout);
} catch (final IOException ex) {
try {