Skip to main content

client_tls_config

Function client_tls_config 

Source
pub fn client_tls_config(
    ca_cert_path: Option<&Path>,
    insecure: bool,
    client_cert_path: Option<&Path>,
    client_key_path: Option<&Path>,
) -> Result<ClientConfig>
Expand description

Build a rustls ClientConfig for outbound TLS connections.

  • ca_cert_path: trust this CA for verifying the server certificate. When None, the root store is empty — supply a CA cert or use insecure.
  • insecure: skip certificate verification entirely. Dev/test only.
  • client_cert_path + client_key_path: when both are Some, the client presents this certificate to the server (mutual TLS). The identity is served through a ReloadingCertifiedKey, so a rotated client cert/key on disk is picked up without a process restart. Both must be set together.