mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 05:55:46 +02:00

These are necessary to get the tests passing with LibreSSL 3.8.1+,
which dropped support for TLSv1.0 and TLSv1.1 for security reasons.
This updates the tests to use TLSv1.2 on OpenBSD. This is only
strictly necessary on OpenBSD 7.4+, but it will work fine in previous
versions as well.
32707b2db5
43 lines
1.2 KiB
Ruby
43 lines
1.2 KiB
Ruby
# frozen_string_literal: false
|
|
require 'drb/drb'
|
|
require 'drb/extserv'
|
|
require 'drb/ssl'
|
|
|
|
if __FILE__ == $0
|
|
def ARGV.shift
|
|
it = super()
|
|
raise "usage: #{$0} <uri> <name>" unless it
|
|
it
|
|
end
|
|
|
|
module DRbTests
|
|
|
|
TEST_KEY_DH1024 = OpenSSL::PKey::DH.new <<-_end_of_pem_
|
|
-----BEGIN DH PARAMETERS-----
|
|
MIGHAoGBAKnKQ8MNK6nYZzLrrcuTsLxuiJGXoOO5gT+tljOTbHBuiktdMTITzIY0
|
|
pFxIvjG05D7HoBZQfrR0c92NGWPkAiCkhQKB8JCbPVzwNLDy6DZ0pmofDKrEsYHG
|
|
AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
|
|
-----END DH PARAMETERS-----
|
|
_end_of_pem_
|
|
|
|
end
|
|
|
|
config = Hash.new
|
|
config[:SSLTmpDhCallback] = proc { DRbTests::TEST_KEY_DH1024 }
|
|
if RUBY_PLATFORM.match?(/openbsd/)
|
|
config[:SSLMinVersion] = OpenSSL::SSL::TLS1_2_VERSION
|
|
config[:SSLMaxVersion] = OpenSSL::SSL::TLS1_2_VERSION
|
|
end
|
|
config[:SSLVerifyMode] = OpenSSL::SSL::VERIFY_PEER
|
|
config[:SSLVerifyCallback] = lambda{|ok,x509_store|
|
|
true
|
|
}
|
|
config[:SSLCertName] =
|
|
[ ["C","JP"], ["O","Foo.DRuby.Org"], ["CN", "Sample"] ]
|
|
|
|
DRb.start_service('drbssl://localhost:0', [1, 2, 'III', 4, "five", 6], config)
|
|
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
|
|
DRb.thread.join
|
|
es.stop_service if es.alive?
|
|
end
|
|
|