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

Windows - Puma compiled without ssl support #3369

Closed
fedorzajac opened this issue Apr 12, 2024 · 7 comments
Closed

Windows - Puma compiled without ssl support #3369

fedorzajac opened this issue Apr 12, 2024 · 7 comments

Comments

@fedorzajac
Copy link

Describe the bug
Cant compile puma with ssl on windows. Did try almost everithing on the internet, but there is mainly only one path line such as:

  • uninstall puma
  • install ssl
  • install puma

To Reproduce

PS C:\Users\fedor\Documents\sf-devops-portal> ruby -rpuma -e "puts Puma.ssl?"
false
PS C:\Users\fedor\Documents\sf-devops-portal> openssl version
OpenSSL 3.2.1 30 Jan 2024 (Library: OpenSSL 3.2.1 30 Jan 2024)
PS C:\Users\fedor\Documents\sf-devops-portal> openssl version -d
OPENSSLDIR: "C:\Program Files\Common Files\SSL"
PS C:\Users\fedor\Documents\sf-devops-portal> gem install puma -- --with-openssl-dir="C:\Program Files\Common Files\SSL"
Using rubygems directory: C:/Users/fedor/.local/share/gem/ruby/3.1.0
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions with: '--with-openssl-dir=C:\Program Files\Common Files\SSL'
This could take a while...
Successfully installed puma-6.4.2
Parsing documentation for puma-6.4.2
Done installing documentation for puma after 1 seconds
1 gem installed
PS C:\Users\fedor\Documents\sf-devops-portal> ruby -rpuma -e "puts Puma.ssl?"
false
PS C:\Users\fedor\Documents\sf-devops-portal> gem uninstall puma
Successfully uninstalled puma-6.4.2
PS C:\Users\fedor\Documents\sf-devops-portal> ruby -rpuma -e "puts Puma.ssl?"
false
PS C:\Users\fedor\Documents\sf-devops-portal> gem install puma -- --with-openssl-dir="C:\Program Files\Common Files\SSL"
Fetching puma-6.4.2.gem
Using rubygems directory: C:/Users/fedor/.local/share/gem/ruby/3.1.0
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions with: '--with-openssl-dir=C:\Program Files\Common Files\SSL'
This could take a while...
Successfully installed puma-6.4.2
Parsing documentation for puma-6.4.2
Installing ri documentation for puma-6.4.2
Done installing documentation for puma after 2 seconds
1 gem installed
PS C:\Users\fedor\Documents\sf-devops-portal> ruby -rpuma -e "puts Puma.ssl?"
false

Expected behavior

ruby -rpuma -e "puts Puma.ssl?" => true

Desktop (please complete the following information):

  • OS: [Windows 11]
  • Puma Version [latest?]

what I am doing wrong? please help. Thank you.

@MSP-Greg
Copy link
Member

MSP-Greg commented Apr 12, 2024

This is a bit messy.

You appear to be using a RubyInstaller2 Ruby 3.1.x, and that Ruby is the last to use OpenSSL 1.1.1. You can check it with the following:

ruby -ropenssl -e "puts OpenSSL::OPENSSL_VERSION, OpenSSL::OPENSSL_LIBRARY_VERSION"

The output should be two lines, both should be the same 'basic' OpenSSL version. In your case, both lines should be

OpenSSL 1.1.1t  7 Feb 2023

So, two points:

  • Use an OpenSSL package that matches the 'base' version of OpenSSL that Ruby was built with. In your case, that's OpenSSL 1.1.1.
  • Use an OpenSSL package that was built with same build tools as your Ruby. Your Ruby was built with MSYS2 UCRT64 tools. JFYI, Ruby can be built with MSYS2 UCRT64, MSYS2 MINGW64, or MSWIN UCRT.

The current MSYS2 OpenSSL is version 3.2.1, so you need to manually download the package:
https://github.com/oneclick/rubyinstaller2-packages/releases/download/ci.ri2/mingw-w64-ucrt-x86_64-openssl-1.1.1.t-1-any.pkg.tar.zst
https://github.com/oneclick/rubyinstaller2-packages/releases/download/ci.ri2/mingw-w64-ucrt-x86_64-openssl-1.1.1.t-1-any.pkg.tar.zst.sig

Place both of the above in a folder without spaces, then run the following:

ridk exec pacman -U <folder>/mingw-w64-ucrt-x86_64-openssl-1.1.1.t-1-any.pkg.tar.zst

After installing the correct OpenSSL package, you should be able to install Puma. Remove the --with-openssl-dir argument from your gem install command.

EDIT: If you want to use OpenSSL 3, install Ruby 3.2 or 3.3. For those Rubies, the command to install the package is:

ridk exec pacman -S mingw-w64-ucrt-x86_64-openssl

@MSP-Greg MSP-Greg changed the title Puma compiled without ssl support Windows - Puma compiled without ssl support Apr 14, 2024
@fedorzajac
Copy link
Author

Thank you for the answer, I will definitely check it out and let you know.

@MSP-Greg
Copy link
Member

You're welcome. I'm 'involved' with 'Windows Ruby', which has nothing to do with my involvement with Puma.

I'm pretty sure it should work for you.

I have built a 1.1.1.w package locally. If you'd like that, I could upload it somewhere. You'd need to add my signing key to your MSYS2 install (or you could temporarily disable the signing key check).

I just used it to build & test Ruby 3.1.4, and all ssl tests passed (with Puma master)...

I think the last official MSYS2 build was 1.1.1.s, see https://repo.msys2.org/mingw/ucrt64/

@fedorzajac
Copy link
Author

Yes, that would be great, many thanks!

@MSP-Greg
Copy link
Member

MSP-Greg commented Apr 16, 2024

See https://github.com/MSP-Greg/ruby-loco/releases/tag/old-ruby

I added some brief instructions for installation...

@MSP-Greg
Copy link
Member

MSP-Greg commented May 3, 2024

@fedorzajac

Wondering if you've had a chance to see if 1.1.1w works?

@fedorzajac
Copy link
Author

@MSP-Greg hi, yes, thank you very much, it worked well.

@MSP-Greg MSP-Greg closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants