TlsSession
struct TlsSessionOpaque, reusable TLS session handle (RFC 5077 / RFC 8446 §4.6.1) captured from a completed TLS handshake.
Constructed exclusively by :meth:TlsStream.session, which
returns the most recent session OpenSSL surfaced via the
new_session_cb callback for the underlying SSL_CTX.
Pass back to :meth:TlsStream.connect_resumed to skip the
expensive part of the handshake on the next connect to the
same origin.
This type is Movable but not Copyable — duplicating
an SSL_SESSION* would require an explicit
SSL_SESSION_up_ref / drop pair which doesn't compose with
Mojo's ASAP destruction. Move into the next call site;
re-capture per round-trip if you want to share across
threads.
The handle owns the underlying SSL_SESSION* via
SSL_SESSION_free on drop. Callers don't normally see the
raw addr; session_addr() is exposed for advanced FFI use.
Implements Movable
- Fields
origin: String:host:portof the connection the session came from, the name that connection verified. :meth:TlsStream.connect_resumedoffers the session only to that same origin.
__init__
def __init__(out self, var lib: OwnedDLHandle, addr: Int, var origin: String = "") __deinit__
def __deinit__(deinit self) session_addr
def session_addr(self) -> Int Underlying SSL_SESSION* as an Int. For advanced FFI integration only — most callers should pass the whole :class:TlsSession to :meth:TlsStream.connect_resumed.