Repository navigation
fix(web_socket): bound the TLS handshake of a wss connection by process_timeout - #741
Merged
Merged
Conversation
…ss_timeout process_timeout bounded the TCP connect but not the TLS handshake after it, so a wss:// host that accepted the connection and never answered TLS hung Browser.new forever. The handshake runs with connect_nonblock under the same deadline as the TCP connect now and raises ConnectTimeoutError when it runs out, closing the socket.
route
force-pushed
the
fix/tls-handshake-timeout
branch
from
November 27, 2026 19:00
dc8ecfa to
5d3fcf4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
:process_timeoutbounds connecting to a running browser at:urlor:ws_url, and raisesConnectTimeoutErrorwhen it runs out. For awss://URL it only covered the TCP connect. The TLS handshake after it was a blockingSSLSocket#connectwith no limit, so a host that accepted the connection and never answered TLS, such as a stuck proxy or load balancer in front of a remote Chrome, hungBrowser.newforever.:timeoutdidn't help either, since no CDP command had been sent yet.The handshake now runs with
connect_nonblock, waiting withwait_readableorwait_writablefor what's left of the same deadline as the TCP connect. When the deadline runs out it raisesConnectTimeoutErrorwith the same message as a TCP connect timeout, and closes the socket. With the default:process_timeoutof 10 seconds a stuck handshake now fails after 10 seconds.process_timeout: nilstill waits indefinitely.Which connections use TLS (port 443 or the
wssscheme) and how the TLS context is set up are unchanged.