#[non_exhaustive]pub struct Server {
pub cert: Vec<PathBuf>,
pub key: Vec<PathBuf>,
pub generate: Vec<String>,
pub root: Vec<PathBuf>,
}Expand description
TLS configuration for the server.
Certificate and keys must currently be files on disk. Alternatively, you can generate a self-signed certificate given a list of hostnames.
In config files, each list field accepts either a single string or a TOML array.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cert: Vec<PathBuf>Load the given certificate from disk.
key: Vec<PathBuf>Load the given key from disk.
generate: Vec<String>Or generate a new certificate and key with the given hostnames. This won’t be valid unless the client uses the fingerprint or disables verification.
root: Vec<PathBuf>PEM file(s) of root CAs for validating optional client certificates (mTLS).
When set, clients may present a certificate during the TLS handshake.
Valid presentations are reported via crate::Request::peer_identity
and can be used by the application to grant elevated access. Clients that
do not present a certificate are unaffected.
Client certificate reporting is only supported by the Quinn and noq QUIC
backends. Plain-TLS listeners built via Self::server_config also use
these roots for optional mTLS when the feature set includes quinn, noq, or
quiche.
Implementations§
Source§impl Server
impl Server
Sourcepub fn load_roots(&self) -> Result<RootCertStore>
pub fn load_roots(&self) -> Result<RootCertStore>
Load all configured root CAs into a rustls::RootCertStore.
Sourcepub fn server_config(&self, alpn: Vec<Vec<u8>>) -> Result<Arc<ServerConfig>>
pub fn server_config(&self, alpn: Vec<Vec<u8>>) -> Result<Arc<ServerConfig>>
Build a rustls::ServerConfig for a plain-TLS (non-QUIC) server, e.g. an
RTMPS or HTTPS listener fronting the QUIC endpoint, reusing the QUIC
backend’s certificate handling: on-disk cert/key pairs, generate
self-signed certs, and optional mTLS root client CAs.
alpn sets the advertised ALPN protocols (e.g.
vec![b"h2".to_vec(), b"http/1.1".to_vec()]); pass an empty list for a
protocol like RTMPS that doesn’t use ALPN.
Trait Implementations§
Source§impl Args for Server
impl Args for Server
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl<'de> Deserialize<'de> for Server
impl<'de> Deserialize<'de> for Server
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>,
Source§impl FromArgMatches for Server
impl FromArgMatches for Server
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.