#[non_exhaustive]pub struct ClientTls {
pub root: Vec<PathBuf>,
pub cert: Option<PathBuf>,
pub key: Option<PathBuf>,
pub disable_verify: Option<bool>,
}Expand description
TLS configuration for the client.
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.root: Vec<PathBuf>Use the TLS root at this path, encoded as PEM.
This value can be provided multiple times for multiple roots. If this is empty, system roots will be used instead
cert: Option<PathBuf>PEM file containing the client certificate chain for mTLS.
Only certificates are extracted; any private keys in the file are ignored.
Must be paired with --client-tls-key.
key: Option<PathBuf>PEM file containing the private key for mTLS.
Only the private key is extracted; any certificates in the file are ignored.
Must be paired with --client-tls-cert.
disable_verify: Option<bool>Danger: Disable TLS certificate verification.
Fine for local development and between relays, but should be used in caution in production.
Implementations§
Source§impl ClientTls
impl ClientTls
Sourcepub fn build(&self) -> Result<ClientConfig>
pub fn build(&self) -> Result<ClientConfig>
Build a rustls::ClientConfig from this configuration.
Loads the configured roots (or the platform’s native roots if none),
optionally attaches a client identity for mTLS, and disables server
certificate verification when disable_verify is set.
Sourcepub fn cert_dns_name(&self) -> Result<Option<String>>
pub fn cert_dns_name(&self) -> Result<Option<String>>
Parse the configured certificate PEM (if any) and return the first DNS SAN on its leaf certificate.
Useful for sanity-checking that a caller’s own cluster node name
matches the certificate they will present. Returns Ok(None) if no
certificate is configured.
Trait Implementations§
Source§impl Args for ClientTls
impl Args for ClientTls
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 ClientTls
impl<'de> Deserialize<'de> for ClientTls
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 ClientTls
impl FromArgMatches for ClientTls
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.