summaryrefslogtreecommitdiff
path: root/test/soap/ssl
diff options
context:
space:
mode:
Diffstat (limited to 'test/soap/ssl')
-rw-r--r--test/soap/ssl/sslsvr.rb7
-rw-r--r--test/soap/ssl/test_ssl.rb29
2 files changed, 27 insertions, 9 deletions
diff --git a/test/soap/ssl/sslsvr.rb b/test/soap/ssl/sslsvr.rb
index 52a8d6878f..4f67eb9485 100644
--- a/test/soap/ssl/sslsvr.rb
+++ b/test/soap/ssl/sslsvr.rb
@@ -51,13 +51,6 @@ if $0 == __FILE__
Thread.current.abort_on_exception = true
$server.start
}
- while $server.status != :Running
- sleep 0.1
- unless t.alive?
- t.join
- raise
- end
- end
STDOUT.sync = true
puts $$
t.join
diff --git a/test/soap/ssl/test_ssl.rb b/test/soap/ssl/test_ssl.rb
index 82bb890d71..d6df970160 100644
--- a/test/soap/ssl/test_ssl.rb
+++ b/test/soap/ssl/test_ssl.rb
@@ -5,7 +5,7 @@ rescue LoadError
end
require 'soap/rpc/driver'
-if defined?(HTTPAccess2)
+if defined?(HTTPAccess2) and defined?(OpenSSL)
module SOAP; module SSL
@@ -130,6 +130,7 @@ __EOP__
@client.loadproperty(testpropertyname)
@client.options["protocol.http.ssl_config.verify_callback"] = method(:verify_callback).to_proc
@verify_callback_called = false
+ # NG with String
begin
@client.hello_world("ssl client")
assert(false)
@@ -137,11 +138,35 @@ __EOP__
assert_equal("certificate verify failed", ssle.message)
assert(@verify_callback_called)
end
- #
+ # NG with Integer
+ @client.options["protocol.http.ssl_config.verify_depth"] = 0
+ begin
+ @client.hello_world("ssl client")
+ assert(false)
+ rescue OpenSSL::SSL::SSLError => ssle
+ assert_equal("certificate verify failed", ssle.message)
+ assert(@verify_callback_called)
+ end
+ # OK with empty
@client.options["protocol.http.ssl_config.verify_depth"] = ""
@verify_callback_called = false
assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
assert(@verify_callback_called)
+ # OK with nil
+ @client.options["protocol.http.ssl_config.verify_depth"] = nil
+ @verify_callback_called = false
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ assert(@verify_callback_called)
+ # OK with String
+ @client.options["protocol.http.ssl_config.verify_depth"] = "3"
+ @verify_callback_called = false
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ assert(@verify_callback_called)
+ # OK with Integer
+ @client.options["protocol.http.ssl_config.verify_depth"] = 3
+ @verify_callback_called = false
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ assert(@verify_callback_called)
ensure
File.unlink(testpropertyname)
end