ssl: support SSLSocket#connect and #accept with timeout - #1098
Open
rhenium wants to merge 2 commits into
Open
Conversation
Let the extension only provide the most basic non-blocking form,
SSLSocket#ssl_connect, #ssl_accept, #ssl_read, #ssl_write.
Implement SSLSocket#connect, #accept, #sysread, and #syswrite in
lib/openssl/ssl.rb on top of these primitives and #wait_{read,writ}able.
Also, handle the keyword arguments for the public #*_nonblock methods
in Ruby to simplify and to avoid the Hash allocation.
This prepares for the upcoming changes to SSLSocket to add proper
timeout support and socket closed state tracking. These would be easier
to do in Ruby.
No user-visible behavior change is intended with this patch.
Add a keyword argument timeout to specify the total time allowed for the TLS handshake to complete. Inspired by Addrinfo#connect(timeout:) and TCPSocket.open(connect_timeout:).
rhenium
force-pushed
the
ky/ssl-handshake-timeout
branch
from
September 2, 2026 12:48
76bc4f0 to
2cf80fe
Compare
Member
|
Do you default to |
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.
Add a keyword argument
timeoutto specify the total time allowed for the TLS handshake to complete. Inspired byAddrinfo#connect(timeout:)andTCPSocket.open(connect_timeout:).Applies on top of #1105