Skip to main content

TlsSection

Struct TlsSection 

Source
pub struct TlsSection {
    pub acme_environment: Option<String>,
    pub contact: Option<Vec<String>>,
    pub cert_source: Option<String>,
    pub mode: Option<String>,
    pub ca_dir: Option<String>,
    pub hsts_max_age_secs: Option<u64>,
    pub hsts_include_subdomains: Option<bool>,
}
Expand description

TLS certificate sourcing, mirroring didbot-tls’s configuration surface.

Reload: the certificate itself hot-reloads once issued (didbot-tls’s SwappableCert); the ACME environment and contact address do not — they govern how the next certificate is obtained, not the one already served.

Fields§

§acme_environment: Option<String>

staging or production ACME directory. Mirrors --acme-environment.

Staging (the default) issues untrusted certificates against generous rate limits, which is what iterating on a deployment wants. Production has hard weekly rate limits, and a run that burns them waits a week.

§contact: Option<Vec<String>>

Contact URIs (mailto:ops@example.com) for the ACME account. Mirrors --acme-contact, and holds the same list.

§cert_source: Option<String>

Where the certificate comes from: acme or a path to a fixed pair, for development.

§mode: Option<String>

Which authority issues this deployment’s certificate: acme or local. Mirrors --tls.

Unset takes the one authority the primary zone may use, which is local for a zone under .localhost and acme for any other.

§ca_dir: Option<String>

The directory holding the local certificate authority local signs with. Mirrors --tls-ca.

Unset keeps it under $XDG_STATE_HOME/didbot, which is one authority per machine: a developer trusts it once, and every local server on that machine presents leaves it signed. Point two checkouts at one directory to share an authority, or at two to keep them apart.

§hsts_max_age_secs: Option<u64>

The max-age of the Strict-Transport-Security header, in seconds. No flag mirrors this, only this key. Unset is 63_072_000, two years, the same as did.bot’s own header (infra/site/).

Sent only by a run with mode = "acme" and acme_environment = "production". A browser that has seen the header refuses a certificate error under the names it covers for this long, with no way to click through, and every other certificate this server can serve chains to a root browsers do not trust.

Reasonable range: 15_768_000 (six months) to 63_072_000 (two years). Below six months, SSL Labs and the HTTP Observatory score the header as absent. 0 tells a browser to drop the header it already holds, which is how a deployment backs out of one.

§hsts_include_subdomains: Option<bool>

Whether the Strict-Transport-Security header carries includeSubDomains. No flag mirrors this, only this key. Unset is false.

true commits every name below the one a browser reached, including names this server does not serve. That is right when this server’s zone is its own domain, so every name below it is an account served under this server’s wildcard certificate. It is wrong when the server sits at a domain that has other hosts.

Trait Implementations§

Source§

impl Clone for TlsSection

Source§

fn clone(&self) -> TlsSection

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TlsSection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TlsSection

Source§

fn default() -> TlsSection

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TlsSection

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TlsSection

Source§

fn eq(&self, other: &TlsSection) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TlsSection

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for TlsSection

Source§

impl StructuralPartialEq for TlsSection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,