diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-25 22:23:34 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-25 22:23:34 +0000 |
commit | c75bba6a93c1f6776bc4139ede7d73e68c5eb9c8 (patch) | |
tree | 6c24feb75e1240c7bfcbd58dbce865c74b49baa9 /test | |
parent | 293451ae51df14c4390c7a187d358e30f7a19b2c (diff) | |
download | ruby-c75bba6a93c1f6776bc4139ede7d73e68c5eb9c8.tar.gz |
test/openssl/test_ssl.rb (test_copy_stream): new test
I was worried r52750 would break IO.copy_stream with things like
OpenSSL sockets which wrap IOs, but require data to be run through
through encryption/decryption filters. Apparently my worry
was unfounded, but perhaps this test will ensure this case continues
to work.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/openssl/test_ssl.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index 9e98a21d33..06e8d96b85 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -178,6 +178,20 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase } end + def test_copy_stream + start_server(OpenSSL::SSL::VERIFY_NONE, true) do |server, port| + server_connect(port) do |ssl| + IO.pipe do |r, w| + str = "hello world\n" + w.write(str) + IO.copy_stream(r, ssl, str.bytesize) + IO.copy_stream(ssl, w, str.bytesize) + assert_equal str, r.read(str.bytesize) + end + end + end + end + def test_client_auth_failure vflag = OpenSSL::SSL::VERIFY_PEER|OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT start_server(vflag, true, :ignore_listener_error => true){|server, port| |