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

extconf.rb - add logging for OpenSSL versions #3370

Merged
merged 2 commits into from Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 14 additions & 9 deletions ext/puma_http11/extconf.rb
Expand Up @@ -16,7 +16,7 @@
found_pkg_config = !has_openssl_dir && pkg_config('openssl')

found_ssl = if !$mingw && found_pkg_config
puts 'using OpenSSL pkgconfig (openssl.pc)'
puts '──── Using OpenSSL pkgconfig (openssl.pc) ────'
true
elsif have_library('libcrypto', 'BIO_read') && have_library('libssl', 'SSL_CTX_new')
true
Expand All @@ -33,26 +33,31 @@

ssl_h = "openssl/ssl.h".freeze

# below is yes for 1.0.2 & later
puts "\n──── Below are yes for 1.0.2 & later ────"
have_func "DTLS_method" , ssl_h
have_func "SSL_CTX_set_session_cache_mode(NULL, 0)", ssl_h
have_func "SSL_CTX_set_ecdh_auto(NULL, 0)" , ssl_h

# below are yes for 1.1.0 & later
puts "\n──── Below are yes for 1.1.0 & later ────"
have_func "TLS_server_method" , ssl_h
have_func "SSL_CTX_set_min_proto_version(NULL, 0)" , ssl_h

# below are yes for 1.1.1 & later
have_func "SSL_CTX_set_ciphersuites(NULL, \"\")" , ssl_h

puts "\n──── Below is yes for 1.1.0 and later, but isn't documented until 1.1.1 ────"
# https://github.com/openssl/openssl/blob/OpenSSL_1_1_0/crypto/x509/x509_lu.c#L220
have_func "X509_STORE_up_ref"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should X509_STORE_up_ref be under 1.1.1? It moved here

https://www.openssl.org/docs/man1.1.0/man3/X509_STORE_up_ref.html is "Page Not Found" but https://www.openssl.org/docs/man1.1.1/man3/X509_STORE_up_ref.html exist

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just updated the PR, added links for the two 'special items'...

have_func "SSL_CTX_set_ecdh_auto(NULL, 0)" , ssl_h

# below exists in 1.1.0 and later, but isn't documented until 3.0.0
puts "\n──── Below is yes for 1.1.0 and later, but isn't documented until 3.0.0 ────"
# https://github.com/openssl/openssl/blob/OpenSSL_1_1_0/include/openssl/ssl.h#L1159
have_func "SSL_CTX_set_dh_auto(NULL, 0)" , ssl_h

# below is yes for 3.0.0 & later
puts "\n──── Below is yes for 1.1.1 & later ────"
have_func "SSL_CTX_set_ciphersuites(NULL, \"\")" , ssl_h

puts "\n──── Below is yes for 3.0.0 & later ────"
have_func "SSL_get1_peer_certificate" , ssl_h

puts ''

# Random.bytes available in Ruby 2.5 and later, Random::DEFAULT deprecated in 3.0
if Random.respond_to?(:bytes)
$defs.push "-DHAVE_RANDOM_BYTES"
Expand Down