add_tls

Function add_tls 

Source
pub fn add_tls(
    builder: ClientBuilder,
    ca_bytes: &[u8],
    cert_bytes: Option<Vec<u8>>,
    key_bytes: Option<Vec<u8>>,
) -> (ClientBuilder, bool)
Expand description

Configure TLS on a reqwest::ClientBuilder by adding a root CA, and optionally a client identity (cert + key) for mutual TLS.

  • ca_bytes must be a PEM-encoded CA certificate; if it cannot be parsed, this returns (builder, false) and leaves the builder unchanged.
  • If both cert_bytes and key_bytes are provided, they are concatenated and parsed as a PEM identity. Identity parse failures are non-fatal: the root CA remains installed and the function still returns true.

Returns (updated_builder, ca_installed).