diff options
author | Nishant Patel <91441876+nishantactivepipe@users.noreply.github.com> | 2022-02-05 14:29:38 +1100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-10-06 18:00:57 +0900 |
commit | cdbaac3f4b6349907fe744f5eafab982b45e53e2 (patch) | |
tree | 410c2731061dc82a485943871c87a9f79102b50d /lib/open-uri.rb | |
parent | 7f80ec47c3e6a1ac4f8c3e626d51ef6598d65b1c (diff) | |
download | ruby-cdbaac3f4b6349907fe744f5eafab982b45e53e2.tar.gz |
[ruby/open-uri] feat: allow option to pass version of SSL / TLS to use during communication. Allow versions are OpenSSL::SSL::SSLContext::METHODS
https://github.com/ruby/open-uri/commit/8729858517
Diffstat (limited to 'lib/open-uri.rb')
-rw-r--r-- | lib/open-uri.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 36bc3e7266..2bcbec5110 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -99,6 +99,7 @@ module OpenURI :open_timeout => true, :ssl_ca_cert => nil, :ssl_verify_mode => nil, + :ssl_version => nil, :ftp_active_mode => false, :redirect => true, :encoding => nil, @@ -298,6 +299,8 @@ module OpenURI require 'net/https' http.use_ssl = true http.verify_mode = options[:ssl_verify_mode] || OpenSSL::SSL::VERIFY_PEER + http.ssl_version = options[:ssl_version] if options[:ssl_version] && + OpenSSL::SSL::SSLContext::METHODS.include?(options[:ssl_version]) store = OpenSSL::X509::Store.new if options[:ssl_ca_cert] Array(options[:ssl_ca_cert]).each do |cert| |