aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_ssl.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-09-06 07:36:17 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-09-07 09:11:19 +0900
commitc9d1659f4027049af451acce8f3240b5fe74cfd8 (patch)
treedf5c9734f7a5a377e4fd31772dd94628f5349d16 /test/test_ssl.rb
parentad2e76adfb2a609cd53c4904b5a810e2b7f332ca (diff)
downloadruby-openssl-c9d1659f4027049af451acce8f3240b5fe74cfd8.tar.gz
test/utils: remove use_anon_cipher option from SSLTestCase#start_servertopic/ssl-test-cleanup
Only TestSSL#test_post_connect_check_with_anon_ciphers uses it. The option just sets 'ADH-AES256-GCM-SHA384' as the available cipher suites and set the security level of the context to 0 - both can be achieved using ctx_proc option of start_server. And we don't have to stick to the cipher suite 'ADH-AES256-GCM-SHA384' so specify 'aNULL' instead. This allows removing the cipher suite existence check.
Diffstat (limited to 'test/test_ssl.rb')
-rw-r--r--test/test_ssl.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/test_ssl.rb b/test/test_ssl.rb
index 23c508c0..0af93a8b 100644
--- a/test/test_ssl.rb
+++ b/test/test_ssl.rb
@@ -356,19 +356,22 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
end
def test_post_connect_check_with_anon_ciphers
- sslerr = OpenSSL::SSL::SSLError
+ ctx_proc = -> ctx {
+ ctx.ciphers = "aNULL"
+ ctx.security_level = 0
+ }
- start_server(use_anon_cipher: true) { |server, port|
+ start_server(ctx_proc: ctx_proc) { |server, port|
ctx = OpenSSL::SSL::SSLContext.new
ctx.ciphers = "aNULL"
ctx.security_level = 0
server_connect(port, ctx) { |ssl|
- assert_raise_with_message(sslerr, /anonymous cipher suite/i){
+ assert_raise_with_message(OpenSSL::SSL::SSLError, /anonymous cipher suite/i) {
ssl.post_connection_check("localhost.localdomain")
}
}
}
- end if OpenSSL::ExtConfig::TLS_DH_anon_WITH_AES_256_GCM_SHA384
+ end
def test_post_connection_check
sslerr = OpenSSL::SSL::SSLError