mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	add test for r48563
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									058044c211
								
							
						
					
					
						commit
						d3236ba3b4
					
				
					 1 changed files with 32 additions and 0 deletions
				
			
		|  | @ -73,12 +73,44 @@ class TestNetHTTPS < Test::Unit::TestCase | |||
|     http.get("/") | ||||
|     http.finish # three times due to possible bug in OpenSSL 0.9.8 | ||||
| 
 | ||||
|     sid = http.instance_variable_get(:@ssl_session).id | ||||
| 
 | ||||
|     http.start | ||||
|     http.get("/") | ||||
| 
 | ||||
|     socket = http.instance_variable_get(:@socket).io | ||||
| 
 | ||||
|     assert socket.session_reused? | ||||
| 
 | ||||
|     assert_equal sid, http.instance_variable_get(:@ssl_session).id | ||||
| 
 | ||||
|     http.finish | ||||
|   rescue SystemCallError | ||||
|     skip $! | ||||
|   end | ||||
| 
 | ||||
|   def test_session_reuse_but_expire | ||||
|     http = Net::HTTP.new("localhost", config("port")) | ||||
|     http.use_ssl = true | ||||
|     http.verify_callback = Proc.new do |preverify_ok, store_ctx| | ||||
|       store_ctx.current_cert.to_der == config('ssl_certificate').to_der | ||||
|     end | ||||
| 
 | ||||
|     http.ssl_timeout = -1 | ||||
|     http.start | ||||
|     http.get("/") | ||||
|     http.finish | ||||
| 
 | ||||
|     sid = http.instance_variable_get(:@ssl_session).id | ||||
| 
 | ||||
|     http.start | ||||
|     http.get("/") | ||||
| 
 | ||||
|     socket = http.instance_variable_get(:@socket).io | ||||
|     assert_equal false, socket.session_reused? | ||||
| 
 | ||||
|     assert_not_equal sid, http.instance_variable_get(:@ssl_session).id | ||||
| 
 | ||||
|     http.finish | ||||
|   rescue SystemCallError | ||||
|     skip $! | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 naruse
						naruse