pub struct CertCache { /* private fields */ }Expand description
Per-hostname leaf certificate cache backed by the session’s EphemeralCa.
Implementations§
Source§impl CertCache
impl CertCache
Sourcepub fn new(ca: Arc<EphemeralCa>) -> Self
pub fn new(ca: Arc<EphemeralCa>) -> Self
Construct a new cache backed by ca.
Sourcepub fn get_or_mint(&self, hostname: &str) -> Result<Arc<CertifiedKey>>
pub fn get_or_mint(&self, hostname: &str) -> Result<Arc<CertifiedKey>>
Look up or mint a leaf certificate for hostname.
Used by tests; production code goes through ResolvesServerCert.
Trait Implementations§
Source§impl ResolvesServerCert for CertCache
impl ResolvesServerCert for CertCache
Source§fn resolve(&self, client_hello: ClientHello<'_>) -> Option<Arc<CertifiedKey>>
fn resolve(&self, client_hello: ClientHello<'_>) -> Option<Arc<CertifiedKey>>
rustls invokes this synchronously during the server-side handshake.
We extract the SNI hostname, look up (or mint) a leaf, and return it.
On failure — empty SNI, mint error, mutex poison — we return None,
causing rustls to fail the handshake. That’s what we want: the agent
sees a TLS error, the CONNECT handler records the failure, no
silent fallback occurs.
Source§fn only_raw_public_keys(&self) -> bool
fn only_raw_public_keys(&self) -> bool
Return true when the server only supports raw public keys.
Auto Trait Implementations§
impl !Freeze for CertCache
impl !RefUnwindSafe for CertCache
impl !UnwindSafe for CertCache
impl Send for CertCache
impl Sync for CertCache
impl Unpin for CertCache
impl UnsafeUnpin for CertCache
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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