pub struct TlsConfig {
pub cert: PathBuf,
pub key: PathBuf,
pub acme: Option<AcmeConfig>,
pub additional_certs: Vec<SniCertEntry>,
}Fields§
§cert: PathBuf§key: PathBuf§acme: Option<AcmeConfig>Optional ACME (Let’s Encrypt) auto-cert. When present and the
framework was built with --features acme, the server obtains and
rotates certs in-process via TLS-ALPN-01 — cert/key above act
as the cache locations rather than pre-existing files.
additional_certs: Vec<SniCertEntry>Additional (server_name, cert, key) triples for SNI-based cert
selection. The top-level cert/key above acts as the default
when no SNI hostname matches an entry here. Empty list = single-cert
behaviour (backward compatible).
Example TOML:
[tls]
cert = "/etc/letsencrypt/live/example.com/fullchain.pem"
key = "/etc/letsencrypt/live/example.com/privkey.pem"
[[tls.certs]]
server_name = "api.example.com"
cert = "/etc/letsencrypt/live/api.example.com/fullchain.pem"
key = "/etc/letsencrypt/live/api.example.com/privkey.pem"
[[tls.certs]]
server_name = "admin.example.com"
cert = "/etc/letsencrypt/live/admin.example.com/fullchain.pem"
key = "/etc/letsencrypt/live/admin.example.com/privkey.pem"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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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