pub struct CertmagicResolver { /* private fields */ }Expand description
Sync rustls resolver: cache fast-path (scheme A) + optional background remediation (scheme C).
Implementations§
Source§impl CertmagicResolver
impl CertmagicResolver
Sourcepub fn new<S>(source: S) -> Selfwhere
S: Into<ResolverSource>,
pub fn new<S>(source: S) -> Selfwhere
S: Into<ResolverSource>,
Create a resolver backed by an in-memory certificate cache or config.
Passing Arc<Cache> selects the cache-only form. Passing Arc<Config> keeps
the legacy certmagic form and retains its default-name behavior.
The resolver starts in cache-only mode; use
Self::with_background_remediation when an uncached name should
trigger a detached on-demand obtain.
Sourcepub fn from_cache(cache: Arc<Cache>) -> Self
pub fn from_cache(cache: Arc<Cache>) -> Self
Create a cache-only resolver explicitly.
Sourcepub fn from_config(config: Arc<Config>) -> Self
pub fn from_config(config: Arc<Config>) -> Self
Create a resolver explicitly from a complete Config.
Sourcepub fn with_background_remediation(config: Arc<Config>, enabled: bool) -> Self
pub fn with_background_remediation(config: Arc<Config>, enabled: bool) -> Self
Create a resolver and choose whether cache misses should schedule a background on-demand obtain.
Sourcepub fn with_on_demand(cache: Arc<Cache>, on_demand: Arc<OnDemandConfig>) -> Self
pub fn with_on_demand(cache: Arc<Cache>, on_demand: Arc<OnDemandConfig>) -> Self
Create a resolver with cache-owned on-demand settings.
The cache owner supplies the complete issuance pipeline. Keeping the
OnDemandConfig here preserves the simple constructor shape while retaining
certmagic’s fail-closed admission and retry logic in Config.
Sourcepub fn set_default_server_name(&mut self, name: Option<String>)
pub fn set_default_server_name(&mut self, name: Option<String>)
Set the server name used when the ClientHello has no SNI.
Sourcepub fn set_fallback_server_name(&mut self, name: Option<String>)
pub fn set_fallback_server_name(&mut self, name: Option<String>)
Set the server name used when no certificate matches the requested SNI.
Sourcepub async fn set_challenge_cert(&self, domain: String, cert: Arc<CertifiedKey>)
pub async fn set_challenge_cert(&self, domain: String, cert: Arc<CertifiedKey>)
Register a TLS-ALPN-01 challenge certificate for domain.
Sourcepub async fn remove_challenge_cert(&self, domain: &str)
pub async fn remove_challenge_cert(&self, domain: &str)
Remove a previously registered TLS-ALPN-01 challenge certificate.
Sourcepub async fn set_default_cert(&self, cert: Arc<CertifiedKey>)
pub async fn set_default_cert(&self, cert: Arc<CertifiedKey>)
Set the certificate used as the final resolver fallback.
Sourcepub async fn clear_default_cert(&self)
pub async fn clear_default_cert(&self)
Clear the resolver’s final fallback certificate.
Trait Implementations§
Source§impl Debug for CertmagicResolver
impl Debug for CertmagicResolver
Source§impl ResolvesServerCert for CertmagicResolver
impl ResolvesServerCert for CertmagicResolver
Source§fn resolve(&self, client_hello: ClientHello<'_>) -> Option<Arc<CertifiedKey>>
fn resolve(&self, client_hello: ClientHello<'_>) -> Option<Arc<CertifiedKey>>
Source§fn only_raw_public_keys(&self) -> bool
fn only_raw_public_keys(&self) -> bool
Auto Trait Implementations§
impl !Freeze for CertmagicResolver
impl !RefUnwindSafe for CertmagicResolver
impl !UnwindSafe for CertmagicResolver
impl Send for CertmagicResolver
impl Sync for CertmagicResolver
impl Unpin for CertmagicResolver
impl UnsafeUnpin for CertmagicResolver
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
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