pub struct MitmCertResolver { /* private fields */ }Expand description
A ResolvesServerCert implementation that generates per-host TLS
certificates on the fly, signed by a CertificateAuthority.
When a client connects with SNI, the resolver generates (or returns a cached) leaf certificate for that hostname. Certificates are cached in an LRU cache to avoid regenerating them on every connection.
Implementations§
Source§impl MitmCertResolver
impl MitmCertResolver
Sourcepub fn new(ca: CertificateAuthority) -> Self
pub fn new(ca: CertificateAuthority) -> Self
Create a resolver with the default LRU cache capacity (1024).
Sourcepub fn with_cache_capacity(ca: CertificateAuthority, capacity: usize) -> Self
pub fn with_cache_capacity(ca: CertificateAuthority, capacity: usize) -> Self
Create a resolver with a custom LRU cache capacity.
Sourcepub fn into_server_config(self) -> ServerConfig
pub fn into_server_config(self) -> ServerConfig
Build a ServerConfig that uses this resolver for certificate selection.
The returned config has no client authentication and no ALPN protocols.
Set config.alpn_protocols if your use case requires protocol
negotiation (e.g. [b"h2", b"http/1.1"] for HTTP).
Trait Implementations§
Source§impl Debug for MitmCertResolver
impl Debug for MitmCertResolver
Source§impl ResolvesServerCert for MitmCertResolver
impl ResolvesServerCert for MitmCertResolver
Source§fn resolve(&self, client_hello: ClientHello<'_>) -> Option<Arc<CertifiedKey>>
fn resolve(&self, client_hello: ClientHello<'_>) -> Option<Arc<CertifiedKey>>
Choose a certificate chain and matching key given simplified
ClientHello information. Read more
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 MitmCertResolver
impl !RefUnwindSafe for MitmCertResolver
impl Send for MitmCertResolver
impl Sync for MitmCertResolver
impl Unpin for MitmCertResolver
impl UnsafeUnpin for MitmCertResolver
impl !UnwindSafe for MitmCertResolver
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