зеркало из https://github.com/github/ruby.git
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:
Родитель
058044c211
Коммит
d3236ba3b4
|
@ -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 $!
|
||||
|
|
Загрузка…
Ссылка в новой задаче