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 | f358a3515f948fe6c66586388e0fdd7292493a67 (patch) | |
tree | ccf0ae61f21d649c32c992a3a71a71effff4cafa /test/openssl/test_ssl.rb | |
parent | 7a91c53eb8118d66e12d11d3623507f375cece7b (diff) | |
download | ruby-f358a3515f948fe6c66586388e0fdd7292493a67.tar.gz |
commit miss
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/test_ssl.rb')
-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) |