puma: OpenSSL 3 - symbol not found in flat namespace '_SSL_get1_peer_certificate'
Describe the bug A clear and concise description of what the bug is.
I’ve been attempting to spin up a new rails 6 or 7 project, but haven’t been able to do so due to a consistent issue with puma and open SSL
puma_http11.bundle, 0x0009): symbol not found in flat namespace '_SSL_get1_peer_certificate'
Puma config:
NA
To Reproduce
Mac 12.0.1 Intel, OpenSSL 3 installed via brew + Puma.
rails new project
–
Anyone able to give some tips here?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 26
- Comments: 43 (19 by maintainers)
Commits related to this issue
- downgrade puma to avoid openssl3 error ref: https://github.com/puma/puma/issues/2790 — committed to goooooouwa/goplan-api by goooooouwa 2 years ago
- Added flags for building puma locally This needs the openssl directory defined, to ensure it picks up v3 Ref: https://github.com/puma/puma/issues/2790#issuecomment-1167746871 — committed to phantomwhale/dotfiles by phantomwhale 10 months ago
I encountered this problem and the way I was able to resolve it is follows,
M1 Max x Ruby 3.0.5 (installed via rbenv 1.2.0-64-gaf9201e) x puma 5.6.4.
I did not have to reinstall ruby to specify build options, or remove openssl@3 😃
not sure if this helps anyone else – but after creating a new rails 7 project, downgrading puma to 4.3 resolves this for me.
I suspect it should be
thanks @dux your solution works fine with my mac pro m1 pro because no need to reinstall ruby
For anyone else having this issue if you have both openssl 3 and 1 - more common these days (2023) - most deployments of puma don’t need ssl support (would normally run behind a proxy) you can get around this issue with
For anyone like me who use rvm, since ‘_SSL_get1_peer_certificate’ belongs to openssl@3 on Mac, remove your current ruby (for a clean install), then run
rvm install RUBY_VERSION --with-openssl-dir=/usr/local/opt/openssl@3
to reinstall ruby with the correct OpenSSL version. (Also good to confirm the existence of/usr/local/opt/openssl@3
before you do this)Experiencing the same issue
symbol not found in flat namespace '_SSL_get1_peer_certificate'
while moving existing Rails application set up to Apple M1Pro macOS 12.1 and OpenSSL 3 is installed via Homebrew. I’m using Ruby 3.0.1Resolved my issue after removing the OpenSSL 3 and
gem install puma -v '5.5.2' -- --with-cppflags=-I$(brew --prefix openssl)/include
using the default openssl installed on macOS i.e.LibreSSL 2.8.3
M1 macbook, ruby 2.6.8, OpenSSL 3 installed along with OpenSSL 1.1
Ran into
symbol not found in flat namespace '_SSL_get1_peer_certificate'
when trying to build a client application. The way I was able to overcome it was by uninstalling my current ruby version and installing it again using these commands.I had the same problem and below was my solution
Rails 7.0.2.2
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin21]
Mac Mini m1 - ProductName: macOS ProductVersion: 12.1 BuildVersion: 21C52
brew --prefix openssl
Hope this helps someone.
what kaysiz said helped me, but unfortunately he made a typo. here are correct commands
I’m going to close this. Unless the following reports OpenSSL 3.0.x, you need to build Ruby with OpenSSL 3.0.x, then install/build Puma.
The first version of Ruby that has been tested with OpenSSL 3 is 3.1.0. You may be able to install the Ruby OpenSSL gem (
gem install openssl
) or later with Ruby 2.6 or later.Hi @MSP-Greg
It is