[前][次][番号順一覧][スレッド一覧]

ruby-changes:48790

From: rhe <ko1@a...>
Date: Sat, 25 Nov 2017 23:12:12 +0900 (JST)
Subject: [ruby-changes:48790] rhe:r60906 (trunk): openssl: revert changes in SSLContext#{min, max}_version= in r60310

rhe	2017-11-25 23:12:07 +0900 (Sat, 25 Nov 2017)

  New Revision: 60906

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60906

  Log:
    openssl: revert changes in SSLContext#{min,max}_version= in r60310
    
    And adapt a net/http test to their old behavior.  [ruby-core:83491]

  Modified files:
    trunk/ext/openssl/lib/openssl/ssl.rb
    trunk/test/net/http/test_https.rb
Index: ext/openssl/lib/openssl/ssl.rb
===================================================================
--- ext/openssl/lib/openssl/ssl.rb	(revision 60905)
+++ ext/openssl/lib/openssl/ssl.rb	(revision 60906)
@@ -148,7 +148,7 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9ekn https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/ssl.rb#L148
 
       # call-seq:
       #    ctx.min_version = OpenSSL::SSL::TLS1_2_VERSION
-      #    ctx.min_version = :TLSv1_2
+      #    ctx.min_version = :TLS1_2
       #    ctx.min_version = nil
       #
       # Sets the lower bound on the supported SSL/TLS protocol version. The
@@ -167,30 +167,18 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9ekn https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/ssl.rb#L167
       #   sock = OpenSSL::SSL::SSLSocket.new(tcp_sock, ctx)
       #   sock.connect # Initiates a connection using either TLS 1.1 or TLS 1.2
       def min_version=(version)
-        case version
-        when nil, Integer
-        else
-          version = (METHODS_MAP[version] or
-            raise ArgumentError, "unknown SSL version `#{version.inspect}'")
-        end
         set_minmax_proto_version(version, @max_proto_version ||= nil)
         @min_proto_version = version
       end
 
       # call-seq:
       #    ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION
-      #    ctx.max_version = :TLSv1_2
+      #    ctx.max_version = :TLS1_2
       #    ctx.max_version = nil
       #
       # Sets the upper bound of the supported SSL/TLS protocol version. See
       # #min_version= for the possible values.
       def max_version=(version)
-        case version
-        when nil, Integer
-        else
-          version = (METHODS_MAP[version] or
-            raise ArgumentError, "unknown SSL version `#{version.inspect}'")
-        end
         set_minmax_proto_version(@min_proto_version ||= nil, version)
         @max_proto_version = version
       end
Index: test/net/http/test_https.rb
===================================================================
--- test/net/http/test_https.rb	(revision 60905)
+++ test/net/http/test_https.rb	(revision 60906)
@@ -195,7 +195,7 @@ class TestNetHTTPS < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/net/http/test_https.rb#L195
   def test_min_version
     http = Net::HTTP.new("127.0.0.1", config("port"))
     http.use_ssl = true
-    http.min_version = :TLSv1
+    http.min_version = :TLS1
     http.verify_callback = Proc.new do |preverify_ok, store_ctx|
       true
     end
@@ -208,7 +208,7 @@ class TestNetHTTPS < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/net/http/test_https.rb#L208
   def test_max_version
     http = Net::HTTP.new("127.0.0.1", config("port"))
     http.use_ssl = true
-    http.max_version = :SSLv2
+    http.max_version = :SSL2
     http.verify_callback = Proc.new do |preverify_ok, store_ctx|
       true
     end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]