Skip to content
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

Mimic MRI's openssl when jopenssl require fails. #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

voxik
Copy link
Contributor

@voxik voxik commented Apr 30, 2015

Some libraries (such as RubyGems [1]) rescues openssl load errors and
adjust their behavior depending if the openssl is properly required.
However, prior this commit, require 'openssl' succeeded just fine, but
the subsequent requires failed, which makes RubyGems (and similar) to
fail unexpectedly.

Please note that I submitted similar jruby/jruby/pull/2894 for 1.7 branch.

[1] https://github.com/rubygems/rubygems/blob/master/lib/rubygems/security.rb#L14

Some libraries (such as RubyGems) rescues openssl load errors and
adjust their behavior depending if the openssl is properly required.
However, prior this commit, require 'openssl' succeeded just fine,
but the subsequent requires failed, which makes RubyGems (and similar)
to fail unexpectedly.
@voxik
Copy link
Contributor Author

voxik commented Apr 30, 2015

Actually, RubyGems checks for e.path == 'openssl' [1] as well, so this is probably not complete patch :/ Not sure if there is better way how to make Ruby think that 'openssl' can't be required.

[1] https://github.com/rubygems/rubygems/blob/master/lib/rubygems/security.rb#L13

@kares
Copy link
Member

kares commented Apr 30, 2015

thanks @voxik, have you tried the other way ... submitting a patch to RGs itself explaining the issue?

@voxik
Copy link
Contributor Author

voxik commented Apr 30, 2015

@kares No, I have not, since I don't believe that RubyGems are the only library in the world using Ruby's OpenSSL. There are probably others which are doing similar check. And to be honest, I believe that most of the SW is tested against MRI and this is MRI compatibility issue.

@voxik
Copy link
Contributor Author

voxik commented Apr 30, 2015

Actually, since output of jruby/jruby#2894 is totally different then anticipated, this might become less critical.

@kares
Copy link
Member

kares commented Apr 30, 2015

@voxik disagree ... most code does defined? OpenSSL or require 'openssl' rescue-ing a LoadError. feel free to prove me wrong with another example, otherwise RG folks might be happy to fix it - if there's a real issue. you should maybe present us a valid use-case where this was an issue under JRuby.

@voxik
Copy link
Contributor Author

voxik commented May 5, 2015

You describe almost precisely what RubyGems does. But if you check the links I provide above, you'd notice that they in addition check what actually was not loaded.

@kares
Copy link
Member

kares commented May 5, 2015

@voxik did check I was asking for another example this being done in the wild (if you read my comment), until than we shall assume only RGs does the "hack" and try to come up with a solution on their side ...

@voxik
Copy link
Contributor Author

voxik commented May 7, 2015

@kares Thanks for opening the RubyGems ticket. Hopefully they will answer soon :)

@mkristian mkristian force-pushed the master branch 2 times, most recently from 6320e12 to dc28d09 Compare March 16, 2016 16:23
@kares kares added the internal label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants