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

patches for ruby for 1.1.1 #552

Open
mcr opened this issue Oct 13, 2022 · 1 comment
Open

patches for ruby for 1.1.1 #552

mcr opened this issue Oct 13, 2022 · 1 comment

Comments

@mcr
Copy link
Contributor

mcr commented Oct 13, 2022

While our PR #399 still needs some work, and our current code base (master) seems to compile against all of my private installations of libssl-dev 1.1.1 (i.e. "make install_sw" of openssl 1.1.1), the openssl code one gets from the ruby git tree (either directly from github), or via rvm fails to compile:

In file included from ossl.h:171,
                 from ossl_ssl.c:12:
ossl_ssl.c: In function ‘ossl_sslctx_session_new_cb’:
openssl_missing.h:99:2: warning: implicit declaration of function ‘CRYPTO_add’ [-Wimplicit-function-declaration]
   99 |  CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_SSL_SESSION);
      |  ^~~~~~~~~~
ossl_ssl.c:422:5: note: in expansion of macro ‘SSL_SESSION_up_ref’
  422 |     SSL_SESSION_up_ref(sess);
      |     ^~~~~~~~~~~~~~~~~~
openssl_missing.h:99:17: error: dereferencing pointer to incomplete type ‘SSL_SESSION’ {aka ‘struct ssl_session_st’}
   99 |  CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_SSL_SESSION);
      |                 ^~

these are things that I'm sure that we've fixed, long ago. But the ruby distro hasn't updated things.
This fails on a fresh ubuntu LTS20.04 install. Ubuntu 22 (which will also be LTS) has moved to openssl 3.0, so it's a total non-starter. (And there are no libtls-dev 1.1.1 that you can easily find)

@rhenium
Copy link
Member

rhenium commented Oct 17, 2022

openssl_missing.h:99:2: warning: implicit declaration of function ‘CRYPTO_add’ [-Wimplicit-function-declaration]
   99 |  CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_SSL_SESSION);
      |  ^~~~~~~~~~

This code should have been enabled when SSL_SESSION_up_ref() does not exist, in other words, for OpenSSL 1.0.2 only. This suggests that extconf.rb somehow detected OpenSSL 1.0.2, but the actual compilation used OpenSSL 1.1 headers. Could you check the mkmf.log?

ruby/ruby and this repository are slightly out of sync, but I don't recall changes that would affect this.

ruby/ruby.git master compiles and passes all tests on both Ubuntu 20.04 and 22.04 according to https://rubyci.org/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants