pub struct OcspStapler { /* private fields */ }Expand description
Background task that periodically refreshes the stapled OCSP response.
RFC 6066 Section 8 / RFC 7633:
The stapler fetches an OCSP response for the server’s end-entity certificate from the configured (or AIA-derived) OCSP responder URL. It replaces the cached response atomically so in-flight handshakes are not affected.
§Refresh strategy
- Fetch at startup (blocking — the server does not accept TLS
connections until the first response is obtained, unless
soft_failistrue). - Re-fetch at
refresh_interval_secsintervals. - On fetch failure: log a warning and keep serving the stale
response if
soft_failis enabled and the response has not passed itsnextUpdatewindow.
Implementations§
Source§impl OcspStapler
impl OcspStapler
Sourcepub fn new(
config: OcspStaplingConfig,
server_cert_der: Vec<u8>,
issuer_cert_der: Option<Vec<u8>>,
) -> Self
pub fn new( config: OcspStaplingConfig, server_cert_der: Vec<u8>, issuer_cert_der: Option<Vec<u8>>, ) -> Self
Create a new OCSP stapler.
§Arguments
config— OCSP stapling configuration from[tls.ocsp_stapling].server_cert_der— DER bytes of the server’s end-entity certificate.issuer_cert_der— DER bytes of the issuing CA certificate (second cert in the chain file). Needed to construct the OCSP request.
Sourcepub fn response_handle(&self) -> OcspResponseHandle
pub fn response_handle(&self) -> OcspResponseHandle
Returns a clone of the shared OCSP response handle.
Pass this to the TLS accept loop so it can read the current stapled response during handshakes.
Auto Trait Implementations§
impl Freeze for OcspStapler
impl !RefUnwindSafe for OcspStapler
impl Send for OcspStapler
impl Sync for OcspStapler
impl Unpin for OcspStapler
impl UnsafeUnpin for OcspStapler
impl !UnwindSafe for OcspStapler
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
Mutably borrows from an owned value. Read more
§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> 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