Skip to main content

base_endpoint/tls/
tls_session.rs

1// Released under the MIT License.
2// Copyright, 2026, by Samuel Williams.
3
4/// Metadata available after a successful TLS handshake. Stream providers can also implement [`TlsStream`](super::TlsStream) for provider-neutral application I/O and orderly shutdown. Retire those operations and send any required TLS close notification before closing the underlying transport.
5pub trait TlsSession: Send {
6    /// The protocol selected by ALPN, or `None` if no protocol was negotiated. Protocol identifiers are opaque bytes; callers must decide whether the selected protocol is acceptable.
7    fn negotiated_protocol(&self) -> Option<&[u8]>;
8}