pub struct TlsConfig {
pub acme_enabled: bool,
pub acme_directory: String,
pub acme_email: Option<String>,
pub cert_dir: String,
pub acme_staging: bool,
pub cert_file: Option<String>,
pub key_file: Option<String>,
pub acme_directory_url: Option<String>,
pub acme_root_pem: Option<String>,
}Expand description
TLS configuration.
Fields§
§acme_enabled: boolEnable ACME (Let’s Encrypt)
acme_directory: StringACME directory URL
acme_email: Option<String>ACME contact email
cert_dir: StringCertificate storage directory
acme_staging: boolUse staging ACME server
cert_file: Option<String>PEM certificate chain for the HTTPS listener.
Set this and key_file to serve TLS from a certificate on disk. Without
them there is no HTTPS listener at all, which means HTTP/2 is only
reachable as cleartext h2c and WebSocket only as ws://.
key_file: Option<String>PEM private key matching cert_file.
acme_directory_url: Option<String>ACME directory URL.
Defaults to Let’s Encrypt production. acme_staging = true switches to
staging, which issues untrusted certificates against far looser rate
limits – use it until the whole flow works, because production’s limits
are per-domain-per-week and are easy to exhaust while debugging.
acme_root_pem: Option<String>A PEM root to trust for the ACME directory’s own TLS.
Only for a CA with a private root, which in practice means a test CA such as Pebble. Never needed for Let’s Encrypt.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TlsConfig
impl<'de> Deserialize<'de> for TlsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TlsConfig
impl RefUnwindSafe for TlsConfig
impl Send for TlsConfig
impl Sync for TlsConfig
impl Unpin for TlsConfig
impl UnsafeUnpin for TlsConfig
impl UnwindSafe for TlsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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