summaryrefslogtreecommitdiff
path: root/ext/openssl/sample/echo_cli.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/sample/echo_cli.rb')
-rw-r--r--ext/openssl/sample/echo_cli.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/openssl/sample/echo_cli.rb b/ext/openssl/sample/echo_cli.rb
index 87dacaf545c..29b356a7ad4 100644
--- a/ext/openssl/sample/echo_cli.rb
+++ b/ext/openssl/sample/echo_cli.rb
@@ -26,11 +26,12 @@ end
s = TCPSocket.new(host, port)
ssl = OpenSSL::SSL::SSLSocket.new(s, ctx)
-ssl.connect
+ssl.connect # start SSL session
+ssl.sync_close = true # if true the underlying socket will be
+ # closed in SSLSocket#close. (default: false)
while line = $stdin.gets
ssl.write line
print ssl.gets
end
ssl.close
-s.close