pub struct TlsClient { /* private fields */ }tokio only.Expand description
A rustls client configuration, and the identity the handshake captured.
The capture is shared with the verifier, so it fills in during the handshake and is readable afterwards without threading anything through the HTTP client.
Implementations§
Source§impl TlsClient
impl TlsClient
Sourcepub fn new(policy: &TlsPolicy) -> Result<Self, Error>
pub fn new(policy: &TlsPolicy) -> Result<Self, Error>
Build a client configuration for a policy.
Sourcepub fn config(&self) -> Arc<ClientConfig> ⓘ
pub fn config(&self) -> Arc<ClientConfig> ⓘ
The configuration, to hand to reqwest or tokio-rustls.
Sourcepub fn captured(&self) -> Option<CapturedIdentity>
pub fn captured(&self) -> Option<CapturedIdentity>
What the last handshake revealed, if one has happened.
Sourcepub fn binding(&self) -> Option<HmacBinding>
pub fn binding(&self) -> Option<HmacBinding>
The leaf fingerprint the last handshake presented, as an HMAC binding.
This is the F of R = HMAC(C, T ‖ F), and it is available only after a request
has actually been made — which is why a pairing driver does the first request
before it can check anything.
Sourcepub fn identity_is_stable(&self) -> bool
pub fn identity_is_stable(&self) -> bool
Whether every handshake so far presented the same leaf.
A LAN pairing runs four requests against a connection pool. If the fingerprint changes between them, something has moved underneath us and the attempt must not continue — the HMAC was computed against a certificate that is no longer the one answering.