Returns the negotiated ALPN protocol (eg: "h2") of nil if no protocol was negotiated.
Returns the current cipher used by this socket.
Returns true if this IO is closed.
Returns the hostname provided through Server Name Indication (SNI)
Returns the OpenSSL::X509::Certificate the peer presented, if a connection was established.
If #sync_close? is true, closing this socket will close the underlying IO.
If #sync_close? is true, closing this socket will close the underlying IO.
Returns the name of the TLS protocol version used by this socket.
Closes the wrapped IO.
Flushes the wrapped IO.
Reads at most slice.size bytes from the wrapped IO into slice.
Rewinds the wrapped IO.
Writes slice entirely into the wrapped IO.
IO::Buffered
IO
IO
Reference
Reference
Reference
Object
Object
Object
Returns the negotiated ALPN protocol (eg: "h2") of nil if no protocol was negotiated.
Returns the hostname provided through Server Name Indication (SNI)
Returns the OpenSSL::X509::Certificate the peer presented, if a connection was established.
NOTE Due to the protocol definition, a TLS/SSL server will always send a certificate, if present. A client will only send a certificate when explicitly requested to do so by the server (see SSL_CTX_set_verify(3)). If an anonymous cipher is used, no certificates are sent. That a certificate is returned does not indicate information about the verification state.
If #sync_close? is true, closing this socket will close the underlying IO.
If #sync_close? is true, closing this socket will close the underlying IO.
Closes the wrapped IO.
TODO Add return type restriction Nil
Flushes the wrapped IO.
TODO Add return type restriction Nil
Reads at most slice.size bytes from the wrapped IO into slice. Returns the number of bytes read.
TODO Add return type restriction Int32
Rewinds the wrapped IO.
TODO Add return type restriction Nil
Writes slice entirely into the wrapped IO.
TODO Add return type restriction Nil
© 2012–2026 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/1.19.0/OpenSSL/SSL/Socket.html