pub struct Policy {
pub renewal_window_ratio: f64,
pub key_type: KeyType,
pub must_staple: bool,
pub reuse_private_keys: bool,
pub disable_ari: bool,
pub issuer_policy: IssuerPolicy,
pub ocsp: OcspConfig,
pub default_server_name: Option<String>,
pub fallback_server_name: Option<String>,
pub disable_storage_check: bool,
pub interactive: bool,
}Expand description
The settings that decide how certificates are obtained, renewed and served.
Every field is a value with a default. Construct it directly, or let
CertManager::builder set the
fields one at a time.
use certon::{KeyType, Policy};
let policy = Policy {
// Renew once two thirds of the lifetime has gone.
renewal_window_ratio: 1.0 / 3.0,
key_type: KeyType::EcdsaP384,
..Policy::default()
};
assert_eq!(policy.key_type, KeyType::EcdsaP384);Fields§
§renewal_window_ratio: f64The fraction of a certificate’s lifetime that must remain before it is
left alone. 1.0 / 3.0 means “renew when a third of the life is left”.
Non-positive values select the default. Values must be finite and no
greater than one; Self::validate checks external configuration.
key_type: KeyTypeThe kind of private key generated for a new certificate.
must_staple: boolAsk for the OCSP Must-Staple extension on new certificates.
Only turn this on if stapling is reliable: a certificate with Must-Staple and no staple is rejected by clients that honour it.
reuse_private_keys: boolRenew onto the existing private key instead of generating a new one.
Needed for HPKP-style pinning, and a liability otherwise: a key that is never rotated is a key that is compromised for longer.
disable_ari: boolIgnore the ACME Renewal Information extension and renew on the ratio alone, even when the certificate authority has said when to come back.
issuer_policy: IssuerPolicyHow to choose among several issuers.
ocsp: OcspConfigOCSP stapling.
default_server_name: Option<String>The name to assume when a TLS client sends no SNI.
fallback_server_name: Option<String>The name to fall back to when no certificate matches the SNI that was sent.
disable_storage_check: boolSkip the storage health probe at start-up.
interactive: boolWhether a person is waiting for the result.
This decides two things, and it is worth being explicit about both because the name only suggests one:
- A failure is returned straight away rather than retried with backoff. Somebody watching a terminal wants the error, not a wait.
- Checks that may ask a question, such as agreeing to a certificate authority’s terms, are permitted.
Leave it false in a server. A background renewal that gives up on the
first network blip is worse than one that waits.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more