-
Notifications
You must be signed in to change notification settings - Fork 167
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
OpenSSL::SSL::SSLSocket writes plaintext to the wire unless #connect is called #9
Comments
Note: rhenium/ruby@195c9ad?w=1 Tthe code is already in the oldest version of 'OpenSSL for Ruby' I could find, but the history before 'SSLSocket' is merged into it is missing. So I still don't know why it is made so. |
@rhenium that's unfortunate 😢 I have run into similar problems with the test suite trying to make improvements like this. |
Actually net/http was the only using the behavior. It has been replaced now: ruby/ruby@4081b34 Since the gem also targets 2.3 for now, we can't remove it immediately, though. |
+1 |
OpenSSL::SSL::SSLSocket allowed #read and #write to be called before an SSL/TLS handshake is completed. They passed unencrypted data to the underlying socket. This behavior is very odd to have in this library. A verbose mode warning "SSL session is not started yet" was emitted whenever this happened. It also didn't behave well with OpenSSL::Buffering. Let's just get rid of it. Fixes: ruby#9
OpenSSL::SSL::SSLSocket allowed #read and #write to be called before an SSL/TLS handshake is completed. They passed unencrypted data to the underlying socket. This behavior is very odd to have in this library. A verbose mode warning "SSL session is not started yet" was emitted whenever this happened. It also didn't behave well with OpenSSL::Buffering. Let's just get rid of it. Fixes: ruby/openssl#9 ruby/openssl@bf780748b3
Repro here:
https://gist.github.com/tarcieri/b20437a1b9364d82c365
Attempting to do I/O before the SSL handshake has completed should raise an exception instead of writing plaintext to the wire.
The text was updated successfully, but these errors were encountered: