diff options
| author | Sharon Rosner <sharon@noteflakes.com> | 2026-01-19 09:15:41 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-01-23 15:38:19 +0000 |
| commit | 05b85fc1abdefd81a5561ac7d7aed433b7a01400 (patch) | |
| tree | d6b1201041728fc4bbe25ad3cf6c58f9dcd3e1f4 /test | |
| parent | f02fffbe0462f5e6b115f86bc5c7e5dc7d47f610 (diff) | |
[ruby/openssl] Add `sync_close` kwarg to `SSLSocket.new` (fixes
https://github.com/ruby/openssl/pull/955)
https://github.com/ruby/openssl/commit/8d9a676dfa
Diffstat (limited to 'test')
| -rw-r--r-- | test/openssl/test_ssl.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index 5d20ccd1f4..6272806585 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -355,6 +355,22 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase end end + def test_sync_close_initialize_opt + start_server do |port| + begin + sock = TCPSocket.new("127.0.0.1", port) + ssl = OpenSSL::SSL::SSLSocket.new(sock, sync_close: true) + assert_equal true, ssl.sync_close + ssl.connect + ssl.puts "abc"; assert_equal "abc\n", ssl.gets + ssl.close + assert_predicate sock, :closed? + ensure + sock&.close + end + end + end + def test_copy_stream start_server do |port| server_connect(port) do |ssl| |
