diff options
author | naruse <naruse@ruby-lang.org> | 2010-12-07 14:24:40 +0000 |
---|---|---|
committer | naruse <naruse@ruby-lang.org> | 2010-12-07 14:24:40 +0000 |
commit | d746412a63d28d1e097d3b0dd8fd0f3e3358c43e (patch) | |
tree | 32029886e301a0670780879950efdaff9e255cef /test | |
parent | 6f76b98b491c18beccc8f4d2a830b7f47fe2318c (diff) | |
download | ruby-openssl-history-d746412a63d28d1e097d3b0dd8fd0f3e3358c43e.tar.gz |
Set DH Parameter for SSLContext to clean warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/test_pair.rb | 3 | ||||
-rw-r--r-- | test/test_ssl.rb | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/test/test_pair.rb b/test/test_pair.rb index 0f54e5b..2d76138 100644 --- a/test/test_pair.rb +++ b/test/test_pair.rb @@ -10,11 +10,13 @@ require 'socket' 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 @@ class OpenSSL::TestPair < Test::Unit::TestCase 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 diff --git a/test/test_ssl.rb b/test/test_ssl.rb index 01c8439..c8e42f4 100644 --- a/test/test_ssl.rb +++ b/test/test_ssl.rb @@ -83,6 +83,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase 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 @@ class OpenSSL::TestSSL < Test::Unit::TestCase #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 |