Skip to content

Conversation

@rschmitt
Copy link
Contributor

@rschmitt rschmitt commented Jun 4, 2025

This change adds basic integration test coverage for TLS handshake timeouts for the sync and async clients. The tests make use of a special test server that times out a single TLS connection attempt and can be configured to time out at two different points in the TLS 4-way handshake.

Note that the TLS handshake timeout, as currently implemented, works like a socket timeout for the TLS handshake phase of the connection: it only limits the amount of time that will be spent on each individual socket read/write operations, not the total time spent in the handshake attempt. The timeout server, for example, could inject a delay before sending the Server Hello, which would cause the client to spend up to double the configured timeout attempting to complete the handshake. There is no test coverage for this behavior, but it could be added if we decided that it should be part of the feature's contract.

@ok2c
Copy link
Member

ok2c commented Jun 5, 2025

@rschmitt Presently all timeouts supported by HC represent the maximum period of inactivity between consecutive i/o operations and not a deadline. There is feature request for request execution deadline support. It would not be easy to implement with the async transport and likely impossible with the classic transport.

This change adds basic integration test coverage for TLS handshake
timeouts for the sync and async clients. The tests make use of a special
test server that times out a single TLS connection attempt and can be
configured to time out at two different points in the TLS 4-way
handshake.

Note that the TLS handshake timeout, as currently implemented, works
like a socket timeout for the TLS handshake phase of the connection: it
only limits the amount of time that will be spent on each individual
socket read/write operations, not the total time spent in the handshake
attempt. The timeout server, for example, could inject a delay before
sending the Server Hello, which would cause the client to spend up to
double the configured timeout attempting to complete the handshake.
There is no test coverage for this behavior, but it could be added if we
decided that it should be part of the feature's contract.
@rschmitt rschmitt force-pushed the handshake-timeout-tests branch from 1d94a5e to b8d352b Compare June 5, 2025 19:59
@rschmitt rschmitt merged commit 1f90c1a into apache:master Jun 6, 2025
10 checks passed
@rschmitt rschmitt deleted the handshake-timeout-tests branch June 6, 2025 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants