puma: Native extension build failure on MRI 2.4.0 linked against OpenSSL 1.1.0*
MRI 2.4.0 changed OpenSSL compatibility, adding 1.1.*. It looks like the Puma native ext currently uses an OpenSSL ABI < 1.1. Probably worth supporting 0.98-1.1 as Ruby 2.4 does.
There’s also a new OpenSSL cpp flag (ie -DOPENSSL_API_COMPAT=0x10000000L
) for apps to ensure they are compiling against a compatible OpenSSL installation.
Steps to reproduce (macOS example)
brew install openssl openssl@1.1 ruby-install chruby
mkdir -p /opt/rubies
ruby-install ruby-2.4.0 --no-install-deps -i /opt/rubies/ruby-2.4.0-ossl1.1 -- --without-X11 --without-tk --disable-install-doc --with-openssl-dir="$(brew --prefix openssl@1.1)" --enable-shared
chruby-exec ruby-2.4.0-ossl1.1 -- gem install puma -v 3.6.2 -N
# watch it crash
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 14
- Comments: 16 (4 by maintainers)
Meet same problem with OpenSSL 1.1.0e and Puma 3.8.0, using Ruby 2.4.0.
I tried to use the following command, and it works! Thanks @cybercode
I have the same problem as OP.
i can build but cant run:
puma_http11.so: undefined symbol: DH_set0_pqg
my stuff:
installing 3.7.1 fixed the issue for me
gem ‘puma’, ‘~> 3.7.1’
With LibreSSL, on alpine:3.5, puma 3.7+ compiles but fails when trying to call
DH_set0_pqg
Note that it will compile and run fine if
DISABLE_SSL
is set at build time (for obvious reasons)The affected code (from
mini_ssl.c
)A possible solution:
3.8.2: tastes great and less filling! 🍻
Same here with alpine:3.5, MRI 2.3.3, OpenSSL 1.0.2k:
LoadError: Error relocating /app/vendor/ruby/2.3.0/gems/puma-3.8.1/lib/puma/puma_http11.so: DH_set0_pqg: symbol not found - /app/vendor/ruby/2.3.0/gems/puma-3.8.1/lib/puma/puma_http11.so