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

ruby-changes:44862

From: rhe <ko1@a...>
Date: Wed, 30 Nov 2016 00:48:53 +0900 (JST)
Subject: [ruby-changes:44862] rhe:r56935 (trunk): open-uri: don't use OpenSSL::TestUtils from open-uri tests

rhe	2016-11-30 00:48:46 +0900 (Wed, 30 Nov 2016)

  New Revision: 56935

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

  Log:
    open-uri: don't use OpenSSL::TestUtils from open-uri tests
    
    Follow net/http. Define own test DH parameters and use.

  Modified files:
    trunk/test/open-uri/test_ssl.rb
Index: test/open-uri/test_ssl.rb
===================================================================
--- test/open-uri/test_ssl.rb	(revision 56934)
+++ test/open-uri/test_ssl.rb	(revision 56935)
@@ -6,7 +6,6 @@ require 'webrick' https://github.com/ruby/ruby/blob/trunk/test/open-uri/test_ssl.rb#L6
 begin
   require 'openssl'
   require 'webrick/https'
-  require_relative '../openssl/utils'
 rescue LoadError
 end
 require 'webrick/httpproxy'
@@ -31,7 +30,7 @@ class TestOpenURISSL https://github.com/ruby/ruby/blob/trunk/test/open-uri/test_ssl.rb#L30
         :SSLEnable => true,
         :SSLCertificate => OpenSSL::X509::Certificate.new(SERVER_CERT),
         :SSLPrivateKey => OpenSSL::PKey::RSA.new(SERVER_KEY),
-        :SSLTmpDhCallback => proc { OpenSSL::TestUtils::TEST_KEY_DH1024 },
+        :SSLTmpDhCallback => proc { OpenSSL::PKey::DH.new(DHPARAMS) },
         :BindAddress => '127.0.0.1',
         :Port => 0})
       _, port, _, host = srv.listeners[0].addr
@@ -173,9 +172,9 @@ class TestOpenURISSL https://github.com/ruby/ruby/blob/trunk/test/open-uri/test_ssl.rb#L172
     }
   end
 
-end if defined?(OpenSSL::TestUtils)
+end if defined?(OpenSSL::SSL)
 
-if defined?(OpenSSL::TestUtils)
+if defined?(OpenSSL::SSL)
 # cp /etc/ssl/openssl.cnf . # I copied from OpenSSL 1.0.2h source
 
 # mkdir demoCA demoCA/private demoCA/newcerts
@@ -386,4 +385,36 @@ P0ZCl31aopNsBcKLiy2v1X116XDwLSHjuc9NmsSX https://github.com/ruby/ruby/blob/trunk/test/open-uri/test_ssl.rb#L385
 -----END RSA PRIVATE KEY-----
 End
 
+TestOpenURISSL::DHPARAMS = <<'End'
+    DH Parameters: (2048 bit)
+        prime:
+            00:ec:4e:a4:06:b6:22:ca:f9:8a:00:cc:d0:ee:2f:
+            16:bf:05:64:f5:8f:fe:7f:c4:bb:b0:24:cd:ef:5d:
+            8a:90:ad:dc:a9:dd:63:84:90:d8:25:ba:d8:78:d5:
+            77:91:42:0a:84:fc:56:1e:13:9b:1c:aa:43:d5:1f:
+            38:52:92:fe:b3:66:f9:e7:e8:8c:77:a1:a6:2f:b3:
+            98:98:d2:13:fc:57:1c:2a:14:dc:bd:e6:9b:54:19:
+            99:4f:ce:81:64:a6:32:7f:8e:61:50:5f:45:3a:e5:
+            0c:f7:13:f3:b8:ad:d5:77:ca:09:42:f7:d8:30:27:
+            7b:2c:f0:b4:b5:a0:04:96:34:0b:47:81:1d:7f:c1:
+            3a:62:86:8e:7d:f8:13:7f:9a:b1:8b:09:23:9e:55:
+            59:41:cd:f0:86:09:c4:b7:d1:69:54:cb:d0:f5:e9:
+            27:c9:e1:81:e4:a1:df:6b:20:1c:df:e8:54:02:f2:
+            37:fc:2a:f7:d5:b3:6f:79:7e:70:22:78:79:18:3c:
+            75:14:68:4a:05:9f:ac:d4:7f:9a:79:db:9d:0a:6e:
+            ec:0a:04:70:bf:c9:4a:59:81:a2:1f:33:9b:4a:66:
+            bc:03:ce:8a:1b:e3:03:ec:ba:39:26:ab:90:dc:39:
+            41:a1:d8:f7:20:3c:8f:af:12:2f:f7:a9:6f:44:f1:
+            6d:03
+        generator: 2 (0x2)
+-----BEGIN DH PARAMETERS-----
+MIIBCAKCAQEA7E6kBrYiyvmKAMzQ7i8WvwVk9Y/+f8S7sCTN712KkK3cqd1jhJDY
+JbrYeNV3kUIKhPxWHhObHKpD1R84UpL+s2b55+iMd6GmL7OYmNIT/FccKhTcveab
+VBmZT86BZKYyf45hUF9FOuUM9xPzuK3Vd8oJQvfYMCd7LPC0taAEljQLR4Edf8E6
+YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
+1bNveX5wInh5GDx1FGhKBZ+s1H+aedudCm7sCgRwv8lKWYGiHzObSma8A86KG+MD
+7Lo5JquQ3DlBodj3IDyPrxIv96lvRPFtAwIBAg==
+-----END DH PARAMETERS-----
+End
+
 end

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

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