pub struct TlsConfig {
pub enabled: bool,
pub cert: Option<PathBuf>,
pub key: Option<PathBuf>,
pub min_version: Option<String>,
pub handshake_ms: Option<u64>,
}Expand description
Inbound TLS termination ([tls] section), served by rustls over the
ring crypto provider.
Off by default, and deliberately not inferred from the presence of a
certificate: turning a port from plaintext to TLS is a decision an
operator makes, not one a stray file makes for them. When it is on,
both paths are required — a half-configured [tls] fails at startup
rather than at the first connection, where the failure would look like
a network problem.
Fields§
§enabled: boolWhether the listener speaks TLS.
cert: Option<PathBuf>PEM file holding the server certificate, leaf first, followed by any intermediates a client needs to build the chain.
key: Option<PathBuf>PEM file holding the matching private key (PKCS#8, PKCS#1 or
SEC1). Read at startup and again on each reload (SIGHUP), which
swaps in renewed material only when the pair validates.
min_version: Option<String>Oldest protocol version accepted: "1.2" or "1.3". Unset means
the floor, TLS 1.2, which is what a public endpoint wants;
"1.3" is for a closed set of clients known to speak it.
The floor cannot be lowered. TLS 1.0 and 1.1 are deprecated
(RFC 8996) and are not settings this server offers under any
spelling — see [TLS_MIN_VERSIONS].
handshake_ms: Option<u64>Deadline for the TLS handshake itself, in milliseconds. Unset
means min(header_read_ms, 10s) — and when [limits] header_read_ms is 0 (disabled), simply 10 s. 0 here is a
startup error, never “unbounded”: the handshake happens before
hyper’s header machinery exists, so a stalled ClientHello holds
a connection slot the header deadline can never reclaim, and 1024
of them close the listener. The header read and the handshake are
different waits on different protocol phases; a streaming
deployment that relaxes the first says nothing about the second.
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<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