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

Use OpenSSL 3.x with Ruby 3.1.x #2000

Merged
merged 1 commit into from
Jul 12, 2022
Merged

Use OpenSSL 3.x with Ruby 3.1.x #2000

merged 1 commit into from
Jul 12, 2022

Conversation

hsbt
Copy link
Member

@hsbt hsbt commented Jul 12, 2022

Related with #1998 (comment)

Ruby 3.1.x already support OpenSSL 3.0. There is no reason why Ruby 3.1 use OpenSSL 1.1.

@hsbt hsbt merged commit d6481c8 into master Jul 12, 2022
@hsbt hsbt deleted the use-openssl3-in-ruby30 branch July 12, 2022 00:48
@eregon
Copy link
Member

eregon commented Jul 12, 2022

Agreed, thanks.

@beporter
Copy link

One reason to use OpenSSL v1.1.x instead of 3.x is that they deprecated a number of methods in 3.0.x. OpenSSL::Digest::MD4.hexdigest, for example. If you have code that happens to use any of those now-deprecated methods, that code will start failing because of this change.

Summarized here: https://dev.to/wetterkrank/openssldigestdigesterror-when-using-md4-3o0i

Switching to OpenSSL 3.x, you should probably enable the legacy providers as well, if you want to maintain full compatibility with 1.1.x.

The workaround is to manually install and compile OpenSSL 1.1.x first, then use RUBY_CONFIGURE_OPTS="--with-openssl-dir=/INSTALL/PATH/HERE" rbenv install to keep using 1.1.x.

@eregon
Copy link
Member

eregon commented May 23, 2023

There was some discussion about this in #2111
The bottom line is longer-term openssl 1.1.x won't be available, and is already not available on recent distros.
So anyway such code needs to be adapted to work on openssl 3.

Similarly about legacy providers, that won't work with a system-installed openssl 3, again Ruby code cannot rely on that if it wants to work on modern distros/Ruby/etc.

@eregon
Copy link
Member

eregon commented May 23, 2023

The workaround is to manually install and compile OpenSSL 1.1.x first, then use RUBY_CONFIGURE_OPTS="--with-openssl-dir=/INSTALL/PATH/HERE" rbenv install to keep using 1.1.x.

And indeed that's the intended workaround when the calling code cannot be changed yet.

@beporter
Copy link

Agreed on all points. I was posting mainly to give people that landed here via Google a path forward.

This was (technically) a breaking change.

@mislav
Copy link
Member

mislav commented May 24, 2023

@beporter Sorry that you've been bitten by a breaking change, and thanks for reporting here and blogging about your findings. 🙇

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.

4 participants