HTTPCLIENT-2099, HTTPCLIENT-2091: SSLConnectionSocketFactory connect timeout fix (#241)
SSLConnectionSocketFactory no longer overrides the socket timeout with the connect timeout when an unlimited socket timeout is configured. This matches behavior of HTTPCLIENT-2091. Note that in scenarios where SocketConfig sets an infinite timeout and the RequestConfig sets a bounded timeout, this change results in the connect-timeout no longer applying to the TLS handshake. This behavior can be retained by setting the expected timeout in the SocketConfig.
This commit is contained in:
parent
a0a2ae0559
commit
5bdcb242f0
|
@ -207,9 +207,6 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
|
|||
sock.bind(localAddress);
|
||||
}
|
||||
try {
|
||||
if (TimeValue.isPositive(connectTimeout) && sock.getSoTimeout() == 0) {
|
||||
sock.setSoTimeout(connectTimeout.toMillisecondsIntBound());
|
||||
}
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Connecting socket to {} with timeout {}", remoteAddress, connectTimeout);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue