On Wed, 2025-07-30 at 12:54 +0200, Cenk Pekyaman wrote: > httpclient5 version: 5.4.4 > httpCore5 version: 5.3.4 > Java version: 17 (21 since recently) > > We are using http-client-5 under our api-client layer with async + > TLS. > Once in a while, we get a timeout exception like this: > "java.net.SocketTimeoutException: 2 SECONDS" in some requests. and > from the > stack trace, we see that the exception is coming from > "InternalDataChannel.onTimeout". but the value we see is actually the > connectTimeout, not the readTimeout(socketTimeout) we set for the > request. > > The explanation we came up with is that, the client completes the > initial > connect step with "InternalConnectChannel" and then the socket is > handed > over to "InternalDataChannel" to do the TLS handshake in "startTls", > which > either takes too long to complete, or hangs. We came to this > conclusion > because the code flow seems to have TLS handshake after connect in > sessionRequest.complete callback and handshake uses connectTimeout by > default (and also our request traces don't show a request reaching > the > server for such cases). > > Our question(s): > 1. Is that really what is happening here.
I cannot say. I need more context / details > 2. Is there anything specific we might check to find the root cause. I need to see exactly how timeouts get configured in your code and I need to see the exact exception stack trace to be able to tell more. > 3. if it is a "tls handshake too long" issue, can http-client throw a > specific exception for that. > I think we could do that. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org