[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-22 Thread Jang Ryeol (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16913422#comment-16913422
 ] 

Jang Ryeol commented on HTTPCLIENT-1765:


[~ggregory] Sure. I made a small Javadoc change here 
([https://github.com/apache/httpcomponents-client/pull/162])

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-22 Thread Gary Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16913356#comment-16913356
 ] 

Gary Gregory commented on HTTPCLIENT-1765:
--

Hi [~northfolk28],

Do you think different Javadoc comments would have helped you here? If so, 
could you propose a PR with improvements?

 

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-22 Thread Jang Ryeol (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16913301#comment-16913301
 ] 

Jang Ryeol commented on HTTPCLIENT-1765:


Yeah adding readTimeout is not that hard.

I thought it has so unreasonable default that it might be a bug -  but it seems 
no one cares.

Anyway thanks for the help.

Regards,
Jang Ryeol

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-22 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16913158#comment-16913158
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1765:
---

[~northfolk28] Correctly configure timeout settings and you will be fine.

Oleg

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-22 Thread Jang Ryeol (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16913153#comment-16913153
 ] 

Jang Ryeol commented on HTTPCLIENT-1765:


Shouldn't it be system default?

As per document 
(https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/config/RequestConfig.html)
 it is expected to be system default, not same as connectTimeout.

And if you set very small value on connectTimeout, it is likely that socket 
timeout would occur. Isn't it unreasonable?

Regards,
Jang Ryeol

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-22 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16913139#comment-16913139
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1765:
---

[~northfolk28] In your code you do not set socket timeout anywhere. Neither at 
the connection manager nor at the request level. The default socket timeout 
value in {{RequestConfig}} is -1 (undefined), not 0 (infinite).

Oleg

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Jang Ryeol (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16912942#comment-16912942
 ] 

Jang Ryeol commented on HTTPCLIENT-1765:


Following exception raised only in HTTPS.

{code}
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at 
org.apache.http.impl.conn.LoggingInputStream.read(LoggingInputStream.java:84)
at 
org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
at 
org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
at 
org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:282)
at 
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at 
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at 
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at 
org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at 
org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:165)
at 
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at 
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at 
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at 
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at 
org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at 
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at 
com.naver.audioplatform.admin.test.HttpClientTest.test(HttpClientTest.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at 
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at 
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at 
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at 
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at 
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at 
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at 

[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16912273#comment-16912273
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1765:
---

[~northfolk28] Please post the exact exception stack trace.

Oleg

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Jang Ryeol (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16912247#comment-16912247
 ] 

Jang Ryeol commented on HTTPCLIENT-1765:


Yes, I see that {{RequestConfig}} has nothing do with connection establishment.

What I'm trying to say is, IF IT IS NOT THE PROBLEM, could you shed some light 
on where should I look for?

 

I made this simple HTTP server that responds after 5 seconds.

Nginx is front of it as proxy for both http and https.
{code:python}
from time import sleep
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
sleep(5);
return 'Hello World!'

if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080)
{code}
 

For {{connectTimeout}} = 1, HTTP request receives respond without exception.

With same {{RequestConfig}}, HTTPS request raises a {{ReadTimeoutException}} 
after the {{connectTimeout}} I've set: 1 second.
{code:java}
public void doTest() {
RequestConfig config = RequestConfig.custom()
.setConnectTimeout(1000).build();
CloseableHttpClient httpclient =

HttpClientBuilder.create().setDefaultRequestConfig(config).build();

/**
 * Success
 */
try {
HttpGet httpGet = new HttpGet("http://test1.ryeol.me;);
HttpResponse response = httpclient.execute(httpGet);
log.info(IOUtils.toString(response.getEntity().getContent(), 
"UTF-8"));
} catch (Exception e) {
log.error("Error", e);
}

/**
 * ReadTimeout
 */
try {
HttpGet httpGet = new HttpGet("https://test1.ryeol.me;);
HttpResponse response = httpclient.execute(httpGet);
log.info(IOUtils.toString(response.getEntity().getContent(), 
"UTF-8"));
} catch (Exception e) {
log.error("Error", e);
}
}
{code}
As you see, the behavior is inconsistent between HTTP and HTTPS, isn't it?

 

And I found that {{connectSocket}} method of {{SSLConnectionSocketFactory}} 
uses same {{connectTimeout}} value that I set on {{RequestConfig}}.

So I figured {{SSLConnectionSocketFactory}} might have to restore the 
{{soTimeout}} to its original value after connection established.
{code:java}
if (connectTimeout > 0 && sock.getSoTimeout() == 0) {
sock.setSoTimeout(connectTimeout);
}
{code}
And you're saying no it's not.

 

Could you please check that what would be the reason?

Or am I wrong, and you can't reproduce above?

 

Regards,
 Jang Ryeol

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16912202#comment-16912202
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1765:
---

[~northfolk28] As I have already said, {{RequestConfig}} applies only _*after*_ 
the connection has been fully established. Until then {{SocketConfig}} set at 
the connection manager level applies.  SSL handshake is considered a part of 
connection routing, not of request execution, therefore connect timeout apply 
in absence socket timeout. This behavior is consistent for both plain HTTP and 
HTTPS. 

Oleg

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Jang Ryeol (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16912162#comment-16912162
 ] 

Jang Ryeol commented on HTTPCLIENT-1765:


No problem with HTTP,

but ReadTimeout on HTTPS with same RequestConfig.

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16912156#comment-16912156
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1765:
---

What exactly is that you find different?

Oleg

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Jang Ryeol (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16912149#comment-16912149
 ] 

Jang Ryeol commented on HTTPCLIENT-1765:


[~olegk]

OK, I see it's not SSLConnectionSocketFactory problem.

Then why HTTP and HTTPS behave differently regarding connectTimeout of 
RequestConfig? Should I open another issue?
{code:java}
@Slf4j
@RunWith(SpringRunner.class)
public class HttpClientTest {
   @Test
   public void test() {
  RequestConfig config = RequestConfig.custom()
 .setConnectTimeout(1000).build();
  CloseableHttpClient httpclient =
 HttpClientBuilder.create().setDefaultRequestConfig(config).build();

  /**
   * Success
   */
  try {
 HttpGet httpGet = new HttpGet("http://test1.ryeol.me;);
 HttpResponse response = httpclient.execute(httpGet);
 log.info(IOUtils.toString(response.getEntity().getContent(), "UTF-8"));
  } catch (Exception e) {
 log.error("Error", e);
  }

  /**
   * ReadTimeout
   */
  try {
 HttpGet httpGet = new HttpGet("https://test1.ryeol.me;);
 HttpResponse response = httpclient.execute(httpGet);
 log.info(IOUtils.toString(response.getEntity().getContent(), "UTF-8"));
  } catch (Exception e) {
 log.error("Error", e);
  }
   }
}
{code}
Regards,

Jang Ryeol

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16912037#comment-16912037
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1765:
---

[~northfolk28] I cannot comment on {{RestTemplate}} behavior. As far as 
HttpClient configuration is concerned, {{RequestConfig}} parameters only apply 
once an HTTP connection route has been fully established (SSL handshake and 
connection tunneling are complete). Please use {{SocketConfig}} in order to 
configure connection level parameters.

Oleg

 

 

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2019-08-21 Thread Jang Ryeol (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16911983#comment-16911983
 ] 

Jang Ryeol commented on HTTPCLIENT-1765:


Why is this marked invalid? connectTimeout should not be used as socketTimeout.

[https://github.com/apache/httpcomponents-client/commit/d954cd287dfcdad8f153e61181e20d253175ca8c]

>From the above commit, connectTimeout also works as readTimeout when no 
>readTimeout specified.

HttpComponentsClientHttpRequestFactory clientHttpRequestFactory = new 
HttpComponentsClientHttpRequestFactory();
clientHttpRequestFactory.setConnectTimeout(1000);
restTemplate = new RestTemplate(clientHttpRequestFactory);

So when you use restTemplate setup above, ReadTimeoutException occurs when 
requests take more than 1s.

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (classic)
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>Priority: Major
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-1765) SSLConnectionSocketFactory uses connectTimeout for read timeout

2016-09-03 Thread Oleg Kalnichevski (JIRA)

[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15461436#comment-15461436
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1765:
---

Why should it? Why should request level parameters have any impact on 
connection level protocols?

Oleg

> SSLConnectionSocketFactory uses connectTimeout for read timeout
> ---
>
> Key: HTTPCLIENT-1765
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1765
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpConn
>Affects Versions: 4.5
> Environment: Any
>Reporter: SATISH BURNWAL
>  Labels: features
>
> SSLConnectionSocketFactory uses connect timeout value for socket.soTimeout as 
> well (as per the code in SSLConnectionsocketFactory). Because of this, when 
> clients are created with such config (below), read timeout is not taking 
> effect.
> RequestConfig.Builder rb = RequestConfig.custom();
>   rb.setConnectTimeout(3000);
>   rb.setExpectContinueEnabled(true);
>   rb.setSocketTimeout(1);
>   rb.setAuthenticationEnabled(true);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org