-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP server do SSL handshake in client fiber #9177
HTTP server do SSL handshake in client fiber #9177
Conversation
…le automatic SSL handshake on `accept`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is ideal, but for now it's good enough as a fix.
We'll need to revisit SSL::Server
when we get to design a generic TLS
API.
Just added a spec and fixed the segfaults due to a double SSL_free call. Because now the |
raise ex | ||
end | ||
|
||
def accept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a breaking change for people using OpenSSL::SSL::Socket::Server
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. I just refactored this fix so it doesn't break compatibility. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really ugly, and I still think that OpenSSL::SSL::Server
needs to go, but it does improve the status quo.
@RX14 I agree with you, like I do with @straight-shoota. I just did the smallest change to fix this bug with the current design, but I'm also with you in that these wrappers around OpenSSL api is not ideal. |
Great! |
This fixes #8108 by forcing the call to
SSL_accept
within the fiber that handles the request.To implement this fix, I added the
OpenSSL::SSL::Server#start_immediately
property just like Ruby does: https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLServer.html