diff options
author | Zachary Scott <e@zzak.io> | 2016-02-02 21:20:06 +0900 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2016-02-02 21:20:06 +0900 |
commit | 48918c444c8f3f895175c26d9c43e3857ad652fd (patch) | |
tree | 568c5894780e4dbf6c149345f3e94685661e7504 /test/test_ssl.rb | |
parent | bc01baca759efc687783e2f46b8d5c610d832b5e (diff) | |
download | ruby-openssl-48918c444c8f3f895175c26d9c43e3857ad652fd.tar.gz |
Upstream ruby/ruby@14920f93c94ed9dd0dc30892df8d10d5c47d6308
Diffstat (limited to 'test/test_ssl.rb')
-rw-r--r-- | test/test_ssl.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_ssl.rb b/test/test_ssl.rb index c193ebe3..a52bf0c9 100644 --- a/test/test_ssl.rb +++ b/test/test_ssl.rb @@ -179,6 +179,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| |