-
Notifications
You must be signed in to change notification settings - Fork 983
HTTPCLIENT-2386: Fix TLS handshake timeout precedence #694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,7 +165,13 @@ public void completed(final IOSession session) { | |
| if (tlsStrategy != null) { | ||
| try { | ||
| final Timeout socketTimeout = connection.getSocketTimeout(); | ||
| final Timeout handshakeTimeout = tlsConfig.getHandshakeTimeout(); | ||
| // TLS handshake timeout precedence: | ||
| // 1. Explicitly configured handshake timeout from TlsConfig | ||
| // 2. Current socket timeout of the connection (if set) | ||
| // 3. Falls back to connectTimeout if neither is specified (handled later) | ||
| final Timeout handshakeTimeout = tlsConfig.getHandshakeTimeout() != null | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rschmitt Would this change be OK with you? This should fix an inconsistency in the behavior of the classic and async transports.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should default to the It also sounds like we could use an integration test here similar to the one for socket timeouts, which can also be set in a variety of ways. Such coverage could be added to the existing integration tests for socket timeouts. I added these tests in order to prevent precisely these kinds of regressions which I've had to deal with in the past, and it's not good that a change like the one in this PR doesn't break any test cases.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're doing Windows development in mingw? Not WSL2 or native Windows?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rschmitt Ubuntu (or Debian) Linux is my primary development environment but sometimes I have to use a client issued laptop that runs Windows. I run Maven inside WinGit console. It is an old habit. |
||
| ? tlsConfig.getHandshakeTimeout() | ||
| : socketTimeout; | ||
| final NamedEndpoint tlsName = endpointName != null ? endpointName : endpointHost; | ||
| onBeforeTlsHandshake(context, endpointHost); | ||
| if (LOG.isDebugEnabled()) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arturobernalg I am not sure this is correct. Connect timeout should no longer have any effect.