Skip to content

Commit c8377ea

Browse files
committed
More documentation.
1 parent c99d24c commit c8377ea

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

lib/openssl/ssl.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,27 @@ def session
460460
end
461461

462462
# Close the stream for reading.
463+
# This method is ignored by OpenSSL as there is no reasonable way to
464+
# implement it, but exists for compatibility with IO.
463465
def close_read
464466
# Unsupported and ignored.
465467
# Just don't read any more.
466468
end
467469

468-
# Close the stream for writing.
470+
# Closes the stream for writing. The behavior of this method depends on
471+
# the version of OpenSSL and the TLS protocol in use.
472+
#
473+
# In TLS 1.3 and later:
474+
# - Sends a 'close_notify' alert to the peer.
475+
# - Does not wait for the peer's 'close_notify' alert in response.
476+
#
477+
# In TLS 1.2 and earlier:
478+
# - Sends a 'close_notify' alert to the peer.
479+
# - Waits for the peer's 'close_notify' alert in response.
480+
#
481+
# Therefore, on TLS 1.2, this method will cause the connection to be
482+
# completely shut down. On TLS 1.3, the connection will remain open for
483+
# reading only.
469484
def close_write
470485
stop
471486
end

0 commit comments

Comments
 (0)