1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2012-05-07 17:18:55 +00:00
parent a135202990
commit 8545d2f4b9

View file

@ -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,7 +496,7 @@ 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