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

Don't use OpenSSL-3, openssl gem doesn't support it yet #2111

Closed
wants to merge 1 commit into from

Conversation

ojab
Copy link

@ojab ojab commented Dec 10, 2022

While openssl gem could be build with openssl-3, it would work correctly in many cases, see ruby/openssl#369.

Use openssl-1.1 instead until compatibility is fixed.

@ojab ojab marked this pull request as ready for review December 10, 2022 16:00
@ojab
Copy link
Author

ojab commented Dec 10, 2022

2 workflows awaiting approval, sending to review.

@eregon
Copy link
Member

eregon commented Dec 10, 2022

What specific incompatibilities are there? Are they likely to impact most Rubyists?
My understanding so far is it only affects code using very specific parts of OpenSSL directly, i.e., it affects very few Ruby workloads but maybe I'm wrong?
And I think it's up to gems/apps using parts of the OpenSSL API which is no longer supported with libssl 3 to migrate, not ruby-build to go down to a version which will be EOL way sooner than v3.

@eregon
Copy link
Member

eregon commented Dec 10, 2022

Also to react to the title

Don't use OpenSSL-3, openssl gem doesn't support it yet

My understanding is the openssl gem does support libssl 3 well, there are still a few edge cases, mostly unlikely to affect many users.

@eregon
Copy link
Member

eregon commented Dec 10, 2022

I think a simple workaround if you do want to use 1.1 specifically is to use the system openssl and make sure that's 1.1.

@bitsmyth
Copy link

I am using ruby-setup for my github actions and am getting this build error. Does this may have a connection to this issue?

[quality.yml/Linters & Style]   ❓  ::group::Installing Bundler
| Using Bundler 2.3.7 from Gemfile.lock BUNDLED WITH 2.3.7
| [command]/opt/hostedtoolcache/Ruby/3.1.2/x64/bin/gem install bundler -v 2.3.7
| ERROR:  While executing gem ... (Gem::Exception)
|     OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
| Took   0.38 seconds
[quality.yml/Linters & Style]   ❓  ::endgroup::
[quality.yml/Linters & Style]   ❗  ::error::Error: The process '/opt/hostedtoolcache/Ruby/3.1.2/x64/bin/gem' failed with exit code 1%0A    at ExecState._setResult (/run/act/actions/ruby-setup-ruby@v1/dist/index.js:5340:25)%0A    at ExecState.CheckComplete (/run/act/actions/ruby-setup-ruby@v1/dist/index.js:5323:18)%0A    at ChildProcess.<anonymous> (/run/act/actions/ruby-setup-ruby@v1/dist/index.js:5217:27)%0A    at ChildProcess.emit (node:events:513:28)%0A    at maybeClose (node:internal/child_process:1100:16)%0A    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
[quality.yml/Linters & Style]   ❌  Failure - Main Setup Ruby
[quality.yml/Linters & Style] exitcode '1': failure
[quality.yml/Linters & Style] 🏁  Job failed

@hsbt
Copy link
Member

hsbt commented Dec 11, 2022

I agreed @eregon 's opinion. Ubuntu 22.04 or other modern Linux distribution only provide OpenSSL 3. We should use OpenSSL and improve it in the future.

@hsbt hsbt closed this Dec 11, 2022
@hsbt
Copy link
Member

hsbt commented Dec 11, 2022

@n1xn Plese file it as new disucussion thread or issue. It's not related openssl.

@ojab
Copy link
Author

ojab commented Dec 14, 2022

@eregon any in the ruby/openssl#369, personally I encountered ruby/openssl#369 (comment).
Not sure about affected %, but this issue is quite hard to debug: usually I work on another machine with openssl-1.1 and when I needed to setup working env and do something on the machine with openssl-3 — I spent an hour or so undesrstanding that failing testsuite is not a setup issue, but openssl issue and rebuilding ruby after dnf install openssl1.1-devel would help.
I agree that the most common usecases are already working, but personally I don't understand why ruby-build chooses subtly-broken openssl version over non-broken one.

@hsbt this PR doesn't prevent anyone from using system openssl-3 and ruby-build could easily switch to providing openssl-3 when it's ready.

@eregon
Copy link
Member

eregon commented Dec 14, 2022

The error in ruby/openssl#369 (comment) seems pretty clear it's an openssl-related issue. So either an issue in the openssl gem or in libssl. And that's worth fixing anyway because e.g. the latest Linux distributions already use libssl 3.

I think to change this we'd need a popular gem that doesn't work with libssl 3 or something like that, and also a PR (title) which doesn't imply libssl3 is not supported because that's not the case.

@mislav
Copy link
Member

mislav commented Dec 14, 2022

@ojab Thanks for bringing this to our attention. Like my teammates, I also don't believe that this edge case is worth a downgrade.

If you are bitten by this, just use RUBY_CONFIGURE_OPTS=--with-openssl-dir=/path/to/openssl to link all your Ruby versions across different machines to the same OpenSSL version.

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.

5 participants