-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
error: implicit declaration of function 'SSL_get1_peer_certificate' #2839
Comments
Workaround: downgrade to puma 5.5.2. |
Certainly possible, but I did nothing to install multiple ones intentionally - they are just indirect dependencies. |
More output:
|
Sorry, I should have probably mentioned this in the other issue. What does |
|
Thanks. Notice that Ruby is using OpenSSL 1.1.1 and the system OpenSSL is 3.0.1. I'm rather macOS challenged. With Ubuntu, I switched my system OpenSSL to 3.0.1, and also build Ruby and Puma with it. Re the compile error:
|
I've also got openssl11 @1.1.1m_0 installed, alongside openssl3 @3.0.1_0+legacy. (Those are the MacPorts versions.) Maybe there's some magic incantation that can point it to the right version when it builds the extension. |
With
|
I tried that, but it did not seem to make a difference. Also, in the previous output, there is already a reference to openssl11:
|
If I edit ext/puma_http11/Makefile to take out -DHAVE_SSL_GET1_PEER_CERTIFICATE from the CPP_FLAGS, it builds. |
It seems like the extconf step is picking up OpenSSL 3 but the C compiler is using OpenSSL 1.1. Is there a way to control what directories the extconf chooses?
|
Sorry for the delay. I've been trying to see if I can repo locally.
That should be set via
Do you know if |
I deleted the gem directory and rebuilt with that bundle config. I can see the option on the line to extconf but no change.
I tried |
Digging though some mind boggling internals of mkmf.rb, I was able to narrow things down a little to this series of checked programs. The first one fails, as expected, but the second one succeeds somehow. Since the second one works, the check is regarded as passed. fails, conftest.c:16:57: error: use of undeclared identifier 'SSL_get1_peer_certificate':
Next try mkmf.rb does, with a different snippet at the end, works:
Maybe the first one is checking for the header declaration and the second is checking if it can be linked against? There aren't any comments in here so it's a head-scratcher. Log attached. |
Did some more work with this. Try either:
or
Not sure if the above needs quotes... I've got Ruby master using OpenSSL 3.0.1, and that is the system default. Without the above, it works. I've got Ruby 3.1.1 built with OpenSSL 1.1.1, and with the above, it also works... |
Unfortunately, no change from adding that --without option. It doesn't seem to change any options on the low level compile command that's undesirably picking up openssl3. |
Interesting. So, my system is not finding OpenSSL 3, but your system is. I've got Ruby master and OpenSSL 3 in the same folder ( Sorry for all the back and forth, but I suspect many people may want to work with both OpenSSL 1.1 and 3.0 for quite a while. Hence, it would helpful if we could get most configurations working... |
Thanks for the help! I will dig into it again tomorrow. |
Continuing to chip away at this, the mkmf config test executes this command to see if the following program can build:
command:
This command erroneously builds and links because of this section:
The first -L/opt/local/lib is picking up openssl3, I believe. Changing the command to this fails the link, as is desired:
|
@wlipa Are you using Homebrew? |
No, I use MacPorts. |
@wlipa Does |
Do we need to do something like this? Setting |
@wlipa Thanks. I wasn't sure what was where on your system. If you use |
@wlipa Does this work? |
No, it does not work. Makefile: https://gist.github.com/wlipa/4b65aeefaba494cad992bac66e8ddcda |
No change with this.
But here, it works! |
This looks like what I need for my setup:
|
No luck with that one. |
I wonder if we could add a section to the README about pointing to the correct ssl location for various setups, especially since we're going to be getting more issues for quite some time re: openSSLv3 I think... |
Maybe an Installation Wiki or Discussion? Agree about OpenSSL version issues... |
A “Troubleshooting” section in the Readme would be nice. |
Unfortunately, this one's back when trying to install puma 5.6.4, even with the bundler config that worked with 5.6.2.
|
Can't see that anything changed in Puma that would make 5.6.4 find OpenSSL 3.0 over 1.1. Did anything else change in your environment? |
I cannot think of anything other than the usual OS upgrades. |
@wlipa can you still install (build) 5.6.2? |
No, I get the same there, so this is not a 5.6.4 thing, but something with my env. What that might be is as mysterious as before... |
I do not need the SSL functionality of puma. Is there, or could there be, a flag to force puma to compile without SSL support? |
I normally use and compile Ruby master with OpenSSL 3. I have OpenSSL 1.1 installed, along with Ruby 3.1. Can't get it to build Puma correctly, and it seems to use the OpenSSL 3 openssl.pc (pkgconfig) file no matter what I do. I'll work more on it this weekend.
Yes. Set |
Ah, that is great! Looks like this solves the problem (if you don't need SSL):
|
Oh we should probably prefix that ENV with |
@MSP-Greg did you see #2839 (comment)? TruffleRuby does some special things re: OpenSSL |
I had this problem and couldn't find much information about it, even fewer possible fixes, and none of them worked. So I hope this helps someone. I have Ruby v2.7.5 installed and it's using these OpenSSL versions: $ ruby -ropenssl -e "puts %Q[\ \ \ Build: #{OpenSSL::OPENSSL_VERSION}\n Runtime: #{OpenSSL::OPENSSL_LIBRARY_VERSION}]"
Build: OpenSSL 1.1.1n 15 Mar 2022
Runtime: OpenSSL 1.1.1n 15 Mar 2022 I was getting the same error as the others; what fixed it for me was installing brew install openssl@1.1 Running PKG_CONFIG_PATH=`brew --prefix openssl@1.1`/lib/pkgconfig/ pkg-config openssl --cflags Should return something like PKG_CONFIG_PATH=`brew --prefix openssl@1.1`/lib/pkgconfig/ gem install puma Doing this solved the issue, and everything seems to be working fine so far. |
Describe the bug
When trying to bundle install in a clean .gem directory and fresh ruby 3.1 install:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: