ruby-changes:18102
From: naruse <ko1@a...>
Date: Tue, 7 Dec 2010 23:24:46 +0900 (JST)
Subject: [ruby-changes:18102] Ruby:r30123 (trunk): Set DH Parameter for SSLContext to clean warnings.
naruse 2010-12-07 23:24:40 +0900 (Tue, 07 Dec 2010) New Revision: 30123 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30123 Log: Set DH Parameter for SSLContext to clean warnings. Modified files: trunk/test/openssl/test_pair.rb trunk/test/openssl/test_ssl.rb Index: test/openssl/test_pair.rb =================================================================== --- test/openssl/test_pair.rb (revision 30122) +++ test/openssl/test_pair.rb (revision 30123) @@ -10,11 +10,13 @@ require_relative '../ruby/ut_eof' module SSLPair + DHParam = OpenSSL::PKey::DH.new(128) def server host = "127.0.0.1" port = 0 ctx = OpenSSL::SSL::SSLContext.new() ctx.ciphers = "ADH" + ctx.tmp_dh_callback = proc { DHParam } tcps = TCPServer.new(host, port) ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx) return ssls @@ -194,6 +196,7 @@ port = 0 ctx = OpenSSL::SSL::SSLContext.new() ctx.ciphers = "ADH" + ctx.tmp_dh_callback = proc { DHParam } serv = TCPServer.new(host, port) port = serv.connect_address.ip_port Index: test/openssl/test_ssl.rb =================================================================== --- test/openssl/test_ssl.rb (revision 30122) +++ test/openssl/test_ssl.rb (revision 30123) @@ -83,6 +83,7 @@ rescue Errno::EBADF, IOError, Errno::EINVAL, Errno::ECONNABORTED, Errno::ENOTSOCK end + DHParam = OpenSSL::PKey::DH.new(128) def start_server(port0, verify_mode, start_immediately, args = {}, &block) ctx_proc = args[:ctx_proc] server_proc = args[:server_proc] @@ -96,6 +97,7 @@ #ctx.extra_chain_cert = [ ca_cert ] ctx.cert = @svr_cert ctx.key = @svr_key + ctx.tmp_dh_callback = proc { DHParam } ctx.verify_mode = verify_mode ctx_proc.call(ctx) if ctx_proc -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/