Closed doconnor-clintel closed 1 year ago
What happens on Ruby 2.7 or 3.x?
I am not particularly interested in spending time on Ruby 2.6 compatibility, if 2.7 and 3.x do not run into this, I'd simply bump the minimum supported version for new releases.
Also, we need a way to reproduce since quite obviously only you have access to your CI env.
Looking at the code in transport.rb
:
begin
require "openssl"
rescue LoadError => _le
$stderr.puts "Could not load OpenSSL"
end
makes me wonder if the OpenSSL version on your CI host is too old to support TLS 1.3, and thus the OpenSSL Ruby extension infers that and doesn't make the constant available.
Older Ruby versions and cutting edge TLS won't necessarily play well together. It took JVM and Erlang TLS implementations a few years to iron out TLS 1.3 support.
I could not reproduce on 2.7 or 3.x, and could not build Ruby 2.6 on ARM64 locally. Trying out a Docker image next.
I cannot reproduce using ruby:2.6
and ruby:slim
(3.x) images:
irb(main):001:0> require "openssl"
=> true
irb(main):002:0> OpenSSL::SSL::TLS1_3_VERSION
=> 772
irb(main):003:0> RUBY_VERSION
=> "2.6.10"
irb(main):001:0> OpenSSL::SSL::TLS1_3_VERSION
(irb):1:in `<main>': uninitialized constant OpenSSL (NameError)
from /usr/local/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
from /usr/local/bin/irb:25:in `load'
from /usr/local/bin/irb:25:in `<main>'
irb(main):002:0> require "openssl"
=> true
irb(main):003:0> OpenSSL::SSL::TLS1_3_VERSION
=> 772
irb(main):004:0> RUBY_VERSION
=> "3.1.3"
Via dependabot;
Strangely, this constant should probably be available even as far back as Ruby 2.5.1: https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html
It might just be a load order issue on our side of things; however Bunny 2.19.0 doesn't appear to experience the issue.