ocsp-stapler 0.1.0

OCSP stapler & client with support for Rustls
Documentation

ocsp-stapler

OCSP stapler for Rustls.

  • Standalone Client that can be used separately
  • Stapler wraps Arc<dyn ResolvesServerCert> trait object and automatically staples all certificates provided by it

Stapler::new() spawns background worker using tokio::spawn so it must be executed in the Tokio context.

Example

// Inner service that provides certificates to Rustls, can be anything
let inner: Arc<dyn ResolvesCerverCert> = ...;

let stapler = Arc::new(ocsp_stapler::Stapler::new(inner));

let server_config = rustls::server::ServerConfig::builder()
        .with_no_client_auth()
        .with_cert_resolver(stapler.clone());

// Then you can use server_config wherever applicable

// Stop the background worker to clean up
stapler.stop().await;