diff options
author | nobu <nobu@ruby-lang.org> | 2012-05-07 17:18:55 +0000 |
---|---|---|
committer | nobu <nobu@ruby-lang.org> | 2012-05-07 17:18:55 +0000 |
commit | a4b9bc679db365d6c24f87d53a7168652e7a44f3 (patch) | |
tree | b0f86a9320f3e73a88e1868de998fbf994d6e23c /test | |
parent | deb28eb3f1a26bfaacf4c96d9fa785ad0653da8a (diff) | |
download | ruby-openssl-history-a4b9bc679db365d6c24f87d53a7168652e7a44f3.tar.gz |
test_ssl.rb: test only if necessary option is available.
* test/openssl/test_ssl.rb (test_forbid_tls_v1_{1,2}_{for_client,from_server}):
test only if necessary option is available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/test_ssl.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_ssl.rb b/test/test_ssl.rb index 147d6df..c6e7767 100644 --- a/test/test_ssl.rb +++ b/test/test_ssl.rb @@ -146,7 +146,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase client_ca_from_server = sslconn.client_ca [@cli_cert, @cli_key] end - server_connect(port, ctx) { |ssl| assert_equal([@ca], client_ca_from_server) } + server_connect(port, ctx) { |ssl| assert_equal([@ca], client_ca_from_server) } } end @@ -471,7 +471,7 @@ if OpenSSL::SSL::SSLContext::METHODS.include? :TLSv1_2 ctx.ssl_version = :TLSv1_1 assert_raise(OpenSSL::SSL::SSLError) { server_connect(port, ctx) } } - end + end if defined?(OpenSSL::SSL::OP_NO_TLSv1_1) def test_forbid_tls_v1_1_from_server start_server_version(:TLSv1_1) { |server, port| @@ -479,7 +479,7 @@ if OpenSSL::SSL::SSLContext::METHODS.include? :TLSv1_2 ctx.options = OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_TLSv1_1 assert_raise(OpenSSL::SSL::SSLError) { server_connect(port, ctx) } } - end + end if defined?(OpenSSL::SSL::OP_NO_TLSv1_1) def test_forbid_tls_v1_2_for_client ctx_proc = Proc.new { |ctx| ctx.options = OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_TLSv1_2 } @@ -488,7 +488,7 @@ if OpenSSL::SSL::SSLContext::METHODS.include? :TLSv1_2 ctx.ssl_version = :TLSv1_2 assert_raise(OpenSSL::SSL::SSLError) { server_connect(port, ctx) } } - end + end if defined?(OpenSSL::SSL::OP_NO_TLSv1_2) def test_forbid_tls_v1_2_from_server start_server_version(:TLSv1_2) { |server, port| @@ -496,14 +496,14 @@ if OpenSSL::SSL::SSLContext::METHODS.include? :TLSv1_2 ctx.options = OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_TLSv1_2 assert_raise(OpenSSL::SSL::SSLError) { server_connect(port, ctx) } } - end + end if defined?(OpenSSL::SSL::OP_NO_TLSv1_2) end private def start_server_version(version, ctx_proc=nil, &blk) - ctx_wrap = Proc.new { |ctx| + ctx_wrap = Proc.new { |ctx| ctx.ssl_version = version ctx_proc.call(ctx) if ctx_proc } |