pub struct SniCertResolver { /* private fields */ }Expand description
Resolves a certificate from the store by the SNI name of the handshake.
Implementations§
Source§impl SniCertResolver
impl SniCertResolver
Sourcepub fn new(fallback: Option<Arc<CertifiedKey>>) -> Self
pub fn new(fallback: Option<Arc<CertifiedKey>>) -> Self
Build a resolver holding nothing but the fallback.
Call refresh to populate it from the store.
Sourcepub fn certified_key(
cert_pem: &[u8],
key_pem: &[u8],
) -> ProxyResult<Arc<CertifiedKey>>
pub fn certified_key( cert_pem: &[u8], key_pem: &[u8], ) -> ProxyResult<Arc<CertifiedKey>>
Build the fallback from the statically configured PEM pair.
Sourcepub async fn refresh(&self, store: &CertificateStore) -> ProxyResult<usize>
pub async fn refresh(&self, store: &CertificateStore) -> ProxyResult<usize>
Reload every certificate the store holds.
Returns how many are now being served. A certificate that will not parse is logged and skipped rather than failing the refresh: one bad row must not take every other tenant’s TLS down with it.
Trait Implementations§
Source§impl Debug for SniCertResolver
Names the domains held, never the keys. A private key that reaches a log is
a private key that has to be rotated.
impl Debug for SniCertResolver
Names the domains held, never the keys. A private key that reaches a log is a private key that has to be rotated.
Source§impl ResolvesServerCert for SniCertResolver
impl ResolvesServerCert for SniCertResolver
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 SniCertResolver
impl !RefUnwindSafe for SniCertResolver
impl !UnwindSafe for SniCertResolver
impl Send for SniCertResolver
impl Sync for SniCertResolver
impl Unpin for SniCertResolver
impl UnsafeUnpin for SniCertResolver
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more