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

Ruby 3.3, OpenSSL providers (ossl-modules) #365

Closed
MSP-Greg opened this issue Dec 26, 2023 · 3 comments · Fixed by #379
Closed

Ruby 3.3, OpenSSL providers (ossl-modules) #365

MSP-Greg opened this issue Dec 26, 2023 · 3 comments · Fixed by #379

Comments

@MSP-Greg
Copy link
Contributor

ruby/openssl added support for 'providers' in version 3.2, which is included with Ruby 3.3.0.

See ruby/openssl#635

Due to the MSYS2 path changes, the single provider included with OpenSSL 3 (legacy.dll) should be located in

bin/lib/ossl-modules

With that change, the following works:

ruby -ropenssl -e "puts OpenSSL::Provider.load('legacy')"
#<OpenSSL::Provider:0x0000028b490138b8>

I also puts the engines folder there, but I don't think 'engines' are supported with OpenSSL 3.2, not sure about earlier.

Sorry, I should have checked this earlier.

Happy Holidays, Greg

@larskanis
Copy link
Member

Thanks @MSP-Greg for testing this! I'm not a big fan of supporting legacy crypto algorithms. Nevertheless OpenSSL provider support should work out of the box. So I'll fix this and add a test case.

@MSP-Greg
Copy link
Contributor Author

I'm not a big fan of supporting legacy crypto algorithms

Agreed.

JFYI, in GitHub Actions, there are two MSYS2 mingw/ucrt archive files assembled. One has OpenSSL 1.1.1, and the other has 3.x. As you know, some of the Rubies have been built with OpenSSL 3.1.

When MSYS2 updated to OpenSSL 3.2, I kept an eye on several repos to see if there were problems (e.g. Puma, which compiles against OpenSSL, and also ruby/openssl). There didn't seem to be problems compiling against 3.2 but running on 3.1.

So, if you see any problems, please ping me.

Have a good New Year, and thanks, Greg

@junaruga
Copy link

I want to see the legacy.dll is located in searched paths or set a search path to find the legacy.dll file.

In Ruby OpenSSL, we are setting the OPENSSL_MODULES manually to find the legacy.dll (legacy provider) as a workaround. However I hope the installer can can fix this issue so that we can remove the workaround.

https://github.com/ruby/openssl/blob/2c1add3aa584b9f63aac31f220201cd97fe3f9d6/.github/workflows/test.yml#L54-L58

As a note, the following openssl.exe command can show the legacy provider if it is loaded in Windows. The openssl/openssl#19368 may be helpful to understand this issue.

$ bin\openssl.exe list -provider legacy -providers

larskanis added a commit that referenced this issue Apr 25, 2024
This is necessary because libcrypt.dll and libssl.dll are located in bin/ruby_builtin_dlls and they search other dlls in ../lib

Fixes #365
larskanis added a commit that referenced this issue Apr 25, 2024
This is necessary because libcrypt.dll and libssl.dll are located in bin/ruby_builtin_dlls and they search other dlls in ../lib

Fixes #365
larskanis added a commit that referenced this issue Apr 25, 2024
This is necessary because libcrypt.dll and libssl.dll are located in bin/ruby_builtin_dlls and they search other dlls in ../lib

Fixes #365
larskanis added a commit to larskanis/openssl that referenced this issue Apr 26, 2024
The issue oneclick/rubyinstaller2#365 was fixed with the 3.2.4 and 3.3.1 releases.
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 a pull request may close this issue.

3 participants