Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::SSL::SSLSocket#close_write
close_write
ext/openssl/lib/openssl/ssl.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/openssl/lib/openssl/ssl.rb, line 601
def close_write
stop
end
Closes the stream for writing. The behavior of this method depends on the version of OpenSSL and the TLS protocol in use.
-
Sends a ‘close_notify’ alert to the peer.
-
Does not wait for the peer’s ‘close_notify’ alert in response.
In TLS 1.2 and earlier:
-
On receipt of a ‘close_notify’ alert, responds with a ‘close_notify’ alert of its own and close down the connection immediately, discarding any pending writes.
Therefore, on TLS 1.2, this method will cause the connection to be completely shut down. On TLS 1.3, the connection will remain open for reading only.