Skip to content

Add SSLSocket ssl_version property like MRI has #38

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

Closed

Conversation

driskell
Copy link
Contributor

@driskell driskell commented Apr 4, 2015

When using Ruby 2.0 we can call .ssl_version on an SSLSocket to see what protocol was negotiated in the handshake. With JRuby this is not possible.

This adds the ssl_version method so we can now do the same thing.

I can't say for certain, but this might be what @jordansissel needs in order to resolve #26 too.

(The Ruby commit: ruby/ruby@060184c)

@kares
Copy link
Member

kares commented Apr 4, 2015

Thanks again Jason, the removed test should be valuable (for some time period) locally (until we hit the same with a JDK update) ... could you maybe add a unless ENV['CI'] or something - no biggie we can do it on top of the commits as they are. related to #26 we do not emulate OpenSSL::SSL::Session (yet)

@driskell driskell force-pushed the sslsocket_ssl_version_property branch from d94a07a to 2ce855b Compare April 7, 2015 08:04
@driskell
Copy link
Contributor Author

driskell commented Apr 7, 2015

I've had it call skip() if running in Travis.

Tested with 1.6.0_65 and 1.7.0_76 Oracle JDK and it seems when running jruby under 1.6.0_65 JDK it works. When running under 1.7.0_76 JDK the SSL server reports "No appropriate protocol (protocol is disable or cipher suites are inappropriate)" - got that error by adding diagnostic in test_helper's server_loop.

@driskell
Copy link
Contributor Author

driskell commented Apr 7, 2015

Looks like since 1.7.0_75, SSLv3 is disabled by default. So there's the culprit. Though I don't know why jruby-openssl isn't able to re-enable it internally...
http://www.oracle.com/technetwork/java/javase/7u75-relnotes-2389086.html

@driskell
Copy link
Contributor Author

driskell commented Apr 7, 2015

Though I guess the ultimate problem is enabling SSLv3 again would enable it for other parts of the JVM, and is thus too dangerous. So something to live with I guess! Maybe the SSLv3 test should just be removed - it was really only to test the return value of ssl_version.

@kares
Copy link
Member

kares commented May 19, 2015

first commit is in 6886484 ... second one was kept out in favour of cfeba09 ... thanks!

@kares kares closed this May 19, 2015
@driskell
Copy link
Contributor Author

Thanks! 👍

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.

NameError: uninitialized constant OpenSSL::SSL::Session
2 participants