Skip to content

Conversation

@joshcooper
Copy link
Contributor

@joshcooper joshcooper commented Sep 22, 2022

The call to @socket.eof? can block when attempting to reuse a persistent connection and there are SSL Handshake messages ready to be read, but no Application Data, such as when the server sends an updated NewSessionTicket in TLS 1.3.

Instead call OpenSSL::SSL::SSLSocket#read_nonblocking, which will read and process the SSL Handshake message, but return nil on EOF or an empty string if no data is available. It may also return :wait_readable or :wait_writable which indicates the socket is reusable.

Filed as https://bugs.ruby-lang.org/issues/19017

The call to `@socket.eof?` can block when attempting to reuse a
persistent connection and there are SSL Handshake messages ready to be
read, but no Application Data, such as when the server sends an updated
NewSessionTicket in TLS 1.3.

Instead call `OpenSSL::SSL::SSLSocket#read_nonblocking`, which will read
and process the SSL Handshake message, but return `nil` on EOF or an empty
string if no data is available. It may also return `:wait_readable` or
`:wait_writable` which indicates the socket is reusable.
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