-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Windows - TLSv1.3 failure with 2.5, 2.6, & trunk #204
Comments
RE: OpenSSL 1.1, #199 might potentially be related |
I last was messing with OpenSSL 1.1.1 back in July thru Sept. Kind of rusty...
|
I just disabled TLSv1.3, and all three failures (2,.5, 2.6, & trunk) passed. I added: ctx.max_version = :TLS1_2 if RUBY_VERSION >= '2.5' to the below: nio4r/spec/nio/selectables/ssl_socket_spec.rb Lines 27 to 30 in 74fd1b1
|
Do you know why this works, is TLS v1.3 not supported? or buggy? |
Honestly, right now, no. I was AFK, but I remembered that whether it was an issue specific to TLSv1.3 was something I hadn't checked earlier...
Well, 1.1.1 was released on 11-Sept, and current release is 1.1.1b. Ruby OpenSSL has been testing with it for quite a while, and I think trunk is tested with it on a macOS build. So, I'd consider it supported.
It's just a little different than earlier versions. I'll look at it more tomorrow. Adding the above change would allow the builds to be removed from 'allow failure', but I assume fixing it is preferred... |
I think I'm happy to defer to your judgement on how we should fix this. But I'm happy to take a closer look when I have time, which right now is very limited for me. |
It's also entirely possible the current tests rely on an implementation detail present in previous TLS versions which differs when TLS 1.3 is enabled. The current tests are what I'd describe as "a little rickety" |
@tarcieri Is that still the case? I did spend some time updating the tests, they were definitely as you describe them before. Can't remember how they are now... I think I fixed them a bit. Let's check. |
Okay, so
Failing at: https://github.com/socketry/nio4r/blob/master/spec/support/selectable_examples.rb#L50 If it's being marked as readable, that might be due to a different buffering strategy. The reason why that line exists I to assert a negative pre-condition before the actual test: https://github.com/socketry/nio4r/blob/master/spec/support/selectable_examples.rb#L54 |
Otherwise, we wouldn't know if it was readable just due to some existing condition or because I wonder why it's being marked as readable, is there actually anything to read, or is it a spurious? In theory there shouldn't be any data, but maybe the underlying socket has some TLS initialization data which is why it's marked as readable. Maybe a simple way to work around this would be to actually do some communication, e.g. let(:message) {"Hello World!"}
peer.write(message)
expect(stream.read(message.bytesize)).to be == message Then, continue with the existing spec. That should ensure that the TLS session is established. The spec could still fail if the underlying stream has some kind of communication. Another way to look at it, is does calling monitor = selector.register(stream, :r)
peer.close
expect(selector.select(0.1)).to include monitor
expect(stream.read(1)).to be_nil |
I might say very likely
TLS 1.2 is 10+ years old, so that's ok. WebSocket (common use for TLS) is somewhat newer, and it and a lot of other things have probably resulted in changes to TLS 1.3. I know from other work that, regarding servers & clients in the same test code, 'what happens when' changed with TLS 1.3. As I recall, careful conditionals allowed the code to work with both 1.2 & 1.3, but tests were added to check both. I've always assumed it could be unstable, as OpenSSL isn't really concerned with what is an unlikely real world application (connected servers & clients in the same code). I'll try the things you've mentioned. I was thinking some of the same things. So, I think I can load OpenSSL 1.1.1 with a macOS build on Travis. I'd like to see if this also occurs with 'compiled' nio4r. I think it also would be helpful to have tests for both 1.2 & 1.3 where needed. I'm happy to work on it this weekend... |
If you can make a PR that fixes this issue that would be awesome :) |
See PR #205. I expect to revisit it when:
|
Follow up to above. Re OpenSSL & Travis (see https://travis-ci.org/MSP-Greg/travis-ruby), the following is what's available: 1.0.1 Trusty I'll have a look at it in a few days, I'd recommend testing on all three (not all Ruby versions.) Puma was only testing against 1.0.2 & 1.1.1, and I broke 1.0.1, with a subsequent complaint about server's running Trusty... Might be helpful for the log to show the OpenSSL version the tests were run with. |
Agree on all points please make a PR. |
See #212, which adds more OpenSSL testing to Travis. |
See PR #203, as above mentioned versions are set to 'allow failure'.
Not sure if the failure is due to Ruby, Ruby OpenSSL, or OpenSSL 1.1.1, which is used for all three Ruby versions. Older Windows Ruby versions use 1.0.2 & 1.0.1, which are passing.
The text was updated successfully, but these errors were encountered: