mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[ruby/openssl] ssl: fix test case test_npn_advertised_protocol_too_long
The list of NPN protocols is validated in SSLContext#setup.
The assert_handshake_error is misleading. The client is unable to start
a handshake at all because the server is not running.
e8db6ffd9e
This commit is contained in:
parent
1f4fc2e608
commit
a8b36314ec
1 changed files with 5 additions and 6 deletions
|
@ -1639,12 +1639,11 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
|
|||
def test_npn_advertised_protocol_too_long
|
||||
return unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb)
|
||||
|
||||
ctx_proc = Proc.new { |ctx| ctx.npn_protocols = ["a" * 256] }
|
||||
start_server_version(:TLSv1_2, ctx_proc) { |port|
|
||||
ctx = OpenSSL::SSL::SSLContext.new
|
||||
ctx.npn_select_cb = -> (protocols) { protocols.first }
|
||||
assert_handshake_error { server_connect(port, ctx) }
|
||||
}
|
||||
assert_raise(OpenSSL::SSL::SSLError) do
|
||||
ctx.npn_protocols = ["a" * 256]
|
||||
ctx.setup
|
||||
end
|
||||
end
|
||||
|
||||
def test_npn_selected_protocol_too_long
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue