pub struct CertificateResolver {
certs: RwLock<DomainMap<Arc<CertifiedKey>>>,
default: RwLock<Option<Arc<CertifiedKey>>>,
}
Expand description
A per-domain ResolvesServerCert
implementor with fallback.
Resolves TLS certificates based on the domain name using links-domainmap
.
The default certificate for unknown or unrecognized domain names can be
specified using default
.
Fields§
§certs: RwLock<DomainMap<Arc<CertifiedKey>>>
The map containing all certificates
default: RwLock<Option<Arc<CertifiedKey>>>
Default certificate/key for unknown and unrecognized domain names
Implementations§
Source§impl CertificateResolver
impl CertificateResolver
Sourcefn get_default(&self) -> Option<Arc<CertifiedKey>>
fn get_default(&self) -> Option<Arc<CertifiedKey>>
Get the default CertifiedKey
if one is configured
Sourcepub fn get(&self, domain: Option<&Domain>) -> Option<Arc<CertifiedKey>>
pub fn get(&self, domain: Option<&Domain>) -> Option<Arc<CertifiedKey>>
Get the matching CertifiedKey
for the given reference identifier
domain name
Sourcepub fn set(&self, domain: Domain, certkey: Arc<CertifiedKey>)
pub fn set(&self, domain: Domain, certkey: Arc<CertifiedKey>)
Set the cert-key pair for the given domain. All future calls to get
or
resolve
with this domain name will return this new CertifiedKey
.
Sourcepub fn set_default(&self, certkey: Option<Arc<CertifiedKey>>)
pub fn set_default(&self, certkey: Option<Arc<CertifiedKey>>)
Set the default cert-key pair for unknown or unrecognized domains. All
future calls to get_default
or resolve
without a domain name or a
domain name not found in any other certificate sources will return this
new CertifiedKey
. Setting the default certificate to None
will
reject requests for unknown or unrecognized domains.
Trait Implementations§
Source§impl Debug for CertificateResolver
impl Debug for CertificateResolver
Source§impl Default for CertificateResolver
impl Default for CertificateResolver
Source§impl ResolvesServerCert for CertificateResolver
impl ResolvesServerCert for CertificateResolver
Auto Trait Implementations§
impl !Freeze for CertificateResolver
impl RefUnwindSafe for CertificateResolver
impl Send for CertificateResolver
impl Sync for CertificateResolver
impl Unpin for CertificateResolver
impl UnwindSafe for CertificateResolver
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request