pub struct TlsSession { /* private fields */ }展开描述
一个基于 rustls 的 TLS 会话
trait 实现§
源代码§impl Session for TlsSession
impl Session for TlsSession
源代码§fn peer_identity(&self) -> Option<Box<dyn Any>>
fn peer_identity(&self) -> Option<Box<dyn Any>>
对于 rustls TlsSession,Any 类型为 Vec<rustls::pki_types::CertificateDer>
源代码§fn initial_keys(&self, dst_cid: &ConnectionId, side: Side) -> Keys
fn initial_keys(&self, dst_cid: &ConnectionId, side: Side) -> Keys
根据客户端的初始目标 ConnectionId 创建初始密钥集
源代码§fn handshake_data(&self) -> Option<Box<dyn Any>>
fn handshake_data(&self) -> Option<Box<dyn Any>>
Get data negotiated during the handshake, if available 更多信息
源代码§fn early_crypto(&self) -> Option<(Box<dyn HeaderKey>, Box<dyn PacketKey>)>
fn early_crypto(&self) -> Option<(Box<dyn HeaderKey>, Box<dyn PacketKey>)>
Get the 0-RTT keys if available (clients only) 更多信息
源代码§fn early_data_accepted(&self) -> Option<bool>
fn early_data_accepted(&self) -> Option<bool>
若 0-RTT 加密数据已被对端接受
源代码§fn is_handshaking(&self) -> bool
fn is_handshaking(&self) -> bool
在连接完全建立之前返回
true。源代码§fn read_handshake(&mut self, buf: &[u8]) -> Result<bool, Error>
fn read_handshake(&mut self, buf: &[u8]) -> Result<bool, Error>
Read bytes of handshake data 更多信息
源代码§fn transport_parameters(&self) -> Result<Option<TransportParameters>, Error>
fn transport_parameters(&self) -> Result<Option<TransportParameters>, Error>
The peer’s QUIC transport parameters 更多信息
源代码§fn write_handshake(&mut self, buf: &mut Vec<u8>) -> Option<Keys>
fn write_handshake(&mut self, buf: &mut Vec<u8>) -> Option<Keys>
Writes handshake bytes into the given buffer and optionally returns the negotiated keys 更多信息
源代码§fn is_valid_retry(
&self,
orig_dst_cid: &ConnectionId,
header: &[u8],
payload: &[u8],
) -> bool
fn is_valid_retry( &self, orig_dst_cid: &ConnectionId, header: &[u8], payload: &[u8], ) -> bool
验证 Retry 数据包的完整性
自动 trait 实现§
impl Freeze for TlsSession
impl !RefUnwindSafe for TlsSession
impl Send for TlsSession
impl Sync for TlsSession
impl Unpin for TlsSession
impl UnsafeUnpin for TlsSession
impl !UnwindSafe for TlsSession
blanket 实现§
源代码§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
源代码§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. 更多信息