jira-importer opened a new issue, #1065: URL: https://github.com/apache/httpcomponents-core/issues/1065
**[Christian Yotov](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kyotov)** opened **[HTTPCORE-561](https://issues.apache.org/jira/browse/HTTPCORE-561?redirect=false)** and commented When http is used over SSL, there is possibility exception to be overlapped. In class `DefaultBHttpClientConnection` in method `isResponseAvailable`, you're expecting `SocketTimeoutException`. If we look in `BhttpConnectionBase`, `fillInputBuffer` method, which is being called by `isResponseAvailable`, you set socket timeout before you start reading from socket and after that. In case socket factory has been created with property autoclosable equals to `true`. Socket will be closed, in case of socket timeout exception. This will cause second exception on second timeout set. ```java private int fillInputBuffer(final int timeout) throws IOException { final Socket socket = this.socketHolder.get(); final int oldtimeout = socket.getSoTimeout(); try { // first you set socket timeout before reading socket.setSoTimeout(timeout); // reading from socket, in case socket has timeout and socket factory // is created with autoclosable equals to true, socket will be closed return this.inbuffer.fillBuffer(); } finally { // This operation will fail, in case socket has been timeout and //socket factory is created with autoclosable socket.setSoTimeout(oldtimeout); } } ``` --- No further details from [HTTPCORE-561](https://issues.apache.org/jira/browse/HTTPCORE-561?redirect=false) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
