Skip to content

Bound the pooled TLS upgrade handshake with connect_timeout - #922

Merged
benoitc merged 1 commit into
masterfrom
fix/pooled-tls-upgrade-timeout
Aug 9, 2026
Merged

Bound the pooled TLS upgrade handshake with connect_timeout#922
benoitc merged 1 commit into
masterfrom
fix/pooled-tls-upgrade-timeout

Conversation

@benoitc

@benoitc benoitc commented Aug 9, 2026

Copy link
Copy Markdown
Owner

The pooled HTTPS upgrade in hackney_conn:upgrade_to_ssl called ssl:connect/2, which has no handshake deadline. A server that accepts TCP then stalls the TLS handshake pins the connection process and its pool slot indefinitely, past connect_timeout. The proxy upgrade paths were already hardened; the pooled direct path was not. Pass the connection's connect_timeout to ssl:connect/3 so a stalled handshake fails instead of hanging.

The pooled HTTPS upgrade called ssl:connect/2, which has no handshake
deadline. A server that accepts TCP then stalls the TLS handshake pinned
the connection process and its pool slot indefinitely, past connect_timeout
and recv_timeout. The proxy upgrade paths were already hardened for this;
the pooled direct path was not.

Pass the connection's connect_timeout to ssl:connect/3 so a stalled
handshake fails instead of hanging.
@benoitc
benoitc force-pushed the fix/pooled-tls-upgrade-timeout branch from 0359367 to 3d048b1 Compare August 9, 2026 09:09
@benoitc
benoitc merged commit a442927 into master Aug 9, 2026
6 checks passed
@benoitc benoitc mentioned this pull request Aug 11, 2026
benoitc added a commit that referenced this pull request Aug 11, 2026
Bundles the fixes merged since 4.7.2 (#914/#915, #918/#919, #920, #921,
#922, #924) and the curl-style Content-Length change (#917/#925). Bumps
dependencies to their latest releases: quic 1.8.0, webtransport 0.4.4,
mimerl 1.5.0, cowboy 2.18.0 (test).
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.

1 participant