Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1544

Show
Ignore:
Timestamp:
05/11/05 22:02:11 (4 years ago)
Author:
nahi
Message:

add test for #104.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/soap/ssl/test_ssl.rb

    r1541 r1544  
    131131      @client.options["protocol.http.ssl_config.verify_callback"] = method(:verify_callback).to_proc 
    132132      @verify_callback_called = false 
     133      # NG with String 
    133134      begin 
    134135        @client.hello_world("ssl client") 
     
    138139        assert(@verify_callback_called) 
    139140      end 
    140       # 
     141      # NG with Integer 
     142      @client.options["protocol.http.ssl_config.verify_depth"] = 0 
     143      begin 
     144        @client.hello_world("ssl client") 
     145        assert(false) 
     146      rescue OpenSSL::SSL::SSLError => ssle 
     147        assert_equal("certificate verify failed", ssle.message) 
     148        assert(@verify_callback_called) 
     149      end 
     150      # OK with empty 
    141151      @client.options["protocol.http.ssl_config.verify_depth"] = "" 
     152      @verify_callback_called = false 
     153      assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) 
     154      assert(@verify_callback_called) 
     155      # OK with nil 
     156      @client.options["protocol.http.ssl_config.verify_depth"] = nil 
     157      @verify_callback_called = false 
     158      assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) 
     159      assert(@verify_callback_called) 
     160      # OK with String 
     161      @client.options["protocol.http.ssl_config.verify_depth"] = "3" 
     162      @verify_callback_called = false 
     163      assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) 
     164      assert(@verify_callback_called) 
     165      # OK with Integer 
     166      @client.options["protocol.http.ssl_config.verify_depth"] = 3 
    142167      @verify_callback_called = false 
    143168      assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))