pub struct CertificateStore { /* private fields */ }Expand description
Certificate store with database metadata and file caching.
Implementations§
Source§impl CertificateStore
impl CertificateStore
Sourcepub async fn new(pool: PgPool, cache_dir: impl AsRef<Path>) -> ProxyResult<Self>
pub async fn new(pool: PgPool, cache_dir: impl AsRef<Path>) -> ProxyResult<Self>
Create a new certificate store.
Sourcepub async fn get(&self, domain: &str) -> Option<Certificate>
pub async fn get(&self, domain: &str) -> Option<Certificate>
Get a certificate for a domain.
Sourcepub async fn save(&self, cert: Certificate) -> ProxyResult<()>
pub async fn save(&self, cert: Certificate) -> ProxyResult<()>
Save a certificate.
Sourcepub async fn remove(&self, domain: &str) -> ProxyResult<()>
pub async fn remove(&self, domain: &str) -> ProxyResult<()>
Remove a certificate.
Sourcepub async fn list_domains(&self) -> ProxyResult<Vec<String>>
pub async fn list_domains(&self) -> ProxyResult<Vec<String>>
List all stored domains.
Sourcepub async fn load_all(&self) -> ProxyResult<Vec<Certificate>>
pub async fn load_all(&self) -> ProxyResult<Vec<Certificate>>
Read every certificate from the database, ignoring both caches.
get answers from memory once a domain has been read
once, which is right for a handshake and wrong for a refresh: a
certificate renewed by another instance would never be noticed, and
this proxy would go on serving the old one until it was restarted. The
database is the authority, so a refresh asks it.
The in-memory cache is replaced with what was read, so the two do not then disagree.
Auto Trait Implementations§
impl !Freeze for CertificateStore
impl !RefUnwindSafe for CertificateStore
impl !UnwindSafe for CertificateStore
impl Send for CertificateStore
impl Sync for CertificateStore
impl Unpin for CertificateStore
impl UnsafeUnpin for CertificateStore
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