diff --git a/lib/rubygems/s3_uri_signer.rb b/lib/rubygems/s3_uri_signer.rb index 1ea9ff06a4..c0b88842a0 100644 --- a/lib/rubygems/s3_uri_signer.rb +++ b/lib/rubygems/s3_uri_signer.rb @@ -1,6 +1,6 @@ require 'base64' require 'digest' -require 'openssl' +require 'rubygems/openssl' ## # S3URISigner implements AWS SigV4 for S3 Source to avoid a dependency on the aws-sdk-* gems diff --git a/test/rubygems/test_bundled_ca.rb b/test/rubygems/test_bundled_ca.rb index 61f70fd10d..b30264a8d4 100644 --- a/test/rubygems/test_bundled_ca.rb +++ b/test/rubygems/test_bundled_ca.rb @@ -1,6 +1,12 @@ # frozen_string_literal: true require 'rubygems/test_case' require 'net/http' +require 'rubygems/openssl' + +unless defined?(OpenSSL::SSL) + warn 'Skipping bundled certificates tests. openssl not found.' +end + require 'rubygems/request' # = Testing Bundled CA @@ -52,4 +58,4 @@ class TestBundledCA < Gem::TestCase def test_accessing_new_index assert_https('fastly.rubygems.org') end -end +end if defined?(OpenSSL::SSL) diff --git a/test/rubygems/test_gem_dependency_installer.rb b/test/rubygems/test_gem_dependency_installer.rb index 7912e00fa6..803b95e88c 100644 --- a/test/rubygems/test_gem_dependency_installer.rb +++ b/test/rubygems/test_gem_dependency_installer.rb @@ -840,6 +840,8 @@ class TestGemDependencyInstaller < Gem::TestCase assert_equal %w[a-1-cpu-other_platform-1], inst.installed_gems.map {|s| s.full_name } end + require 'rubygems/openssl' + if defined? OpenSSL def test_install_security_policy util_setup_gems diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index b99d12a044..f635be859b 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -2431,6 +2431,9 @@ end end def test_to_ruby_with_rsa_key + require 'rubygems/openssl' + skip 'openssl is missing' unless defined?(OpenSSL::PKey::RSA) + rsa_key = OpenSSL::PKey::RSA.new(2048) @a2.signing_key = rsa_key ruby_code = @a2.to_ruby