pub struct TlsEndpoint { /* private fields */ }Expand description
A mutual TLS endpoint with a dedicated trust anchor and an exact peer leaf pin.
Implementations§
Source§impl TlsEndpoint
impl TlsEndpoint
Sourcepub fn from_identity(
identity: TlsIdentity,
trust_anchor: &X509Ref,
peer_leaf: &X509Ref,
) -> Result<TlsEndpoint, Error>
pub fn from_identity( identity: TlsIdentity, trust_anchor: &X509Ref, peer_leaf: &X509Ref, ) -> Result<TlsEndpoint, Error>
Configure mutual TLS with a provisioned local signing identity, a dedicated trust anchor and an exact peer leaf pin. The handshake verifies the chain and certificate purpose before accepting the pinned peer.
Sourcepub fn peer_fingerprint(&self) -> [u8; 32]
pub fn peer_fingerprint(&self) -> [u8; 32]
The SHA-256 certificate fingerprint captured by this endpoint’s verification callback.
Sourcepub async fn connect(
&self,
address: SocketAddr,
sni: &str,
budget: Duration,
) -> Result<SslStream<TcpStream>, Error>
pub async fn connect( &self, address: SocketAddr, sni: &str, budget: Duration, ) -> Result<SslStream<TcpStream>, Error>
Dials the literal loopback address and sends SNI within one setup budget.
Auto Trait Implementations§
impl Freeze for TlsEndpoint
impl RefUnwindSafe for TlsEndpoint
impl Send for TlsEndpoint
impl Sync for TlsEndpoint
impl Unpin for TlsEndpoint
impl UnsafeUnpin for TlsEndpoint
impl UnwindSafe for TlsEndpoint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more