Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::SSL::SSLSocket#connect_nonblock
(?exception: true) -> self
(exception: false) -> (self | :wait_readable | :wait_writable)
ssl.connect_nonblock → self
ssl.connect_nonblock(exception: false) → self, :wait_readable, or :wait_writable
ext/openssl/lib/openssl/ssl.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/openssl/lib/openssl/ssl.rb, line 453
def connect_nonblock(exception: true)
ret = ssl_connect
check_nonblock(ret) if exception
ret
end
Initiates the SSL/TLS handshake as a client in non-blocking manner.
Example
# emulates blocking connect begin ssl.connect_nonblock rescue IO::WaitReadable IO.select([s2]) retry rescue IO::WaitWritable IO.select(nil, [s2]) retry end
By specifying a keyword argument exception to false, you can indicate that connect_nonblock should not raise an IO::WaitReadable or IO::WaitWritable exception, but return the symbol :wait_readable or :wait_writable instead.
See also
#connect
#export_keying_material
#close_write
#finished_message
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0