diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-27 03:22:28 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-27 03:22:28 +0000 |
commit | 08be34a96995b483bf4085c37cb507969e94fe86 (patch) | |
tree | ccf0ae61f21d649c32c992a3a71a71effff4cafa | |
parent | f294fe3defe21253ecf9a07ce35cf8df99990097 (diff) | |
download | ruby-08be34a96995b483bf4085c37cb507969e94fe86.tar.gz |
commit miss
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/openssl/test_ssl.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index d714b4010f..232747dffa 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -607,6 +607,14 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase cert end + def socketpair + if defined? UNIXSocket + UNIXSocket.pair + else + Socket.pair(Socket::AF_INET, Socket::SOCK_STREAM, 0) + end + end + def test_servername_cb_sets_context_on_the_socket hostname = 'example.org' @@ -617,7 +625,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase ctx2.ciphers = "DH" ctx2.servername_cb = lambda { |args| ctx3 } - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) @@ -647,7 +655,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase ctx2.ciphers = "DH" ctx2.servername_cb = lambda { |args| Object.new } - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) @@ -683,7 +691,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase ctx2.ciphers = "DH" ctx2.servername_cb = lambda { |args| ctx3 } - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) @@ -712,7 +720,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase ctx2.ciphers = "DH" ctx2.servername_cb = lambda { |args| nil } - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) @@ -746,7 +754,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase ctx2 end - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) |