Skip to content

ssl: implement blocking SSLSocket methods in Ruby - #1105

Open
rhenium wants to merge 1 commit into
ruby:masterfrom
rhenium:ky/ssl-blocking-in-ruby
Open

ssl: implement blocking SSLSocket methods in Ruby#1105
rhenium wants to merge 1 commit into
ruby:masterfrom
rhenium:ky/ssl-blocking-in-ruby

Conversation

@rhenium

@rhenium rhenium commented Sep 2, 2026

Copy link
Copy Markdown
Member

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.

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.
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