Add a tls_built_in_root_certs option for Client (#1150)

This commit is contained in:
Alexis Mousset
2021-01-27 15:39:36 +01:00
committed by GitHub
parent bd9ff9f371
commit 31b11c3f4c
3 changed files with 57 additions and 1 deletions

View File

@@ -433,6 +433,22 @@ impl ClientBuilder {
self.with_inner(move |inner| inner.add_root_certificate(cert))
}
/// Controls the use of built-in system certificates during certificate validation.
///
/// Defaults to `true` -- built-in system certs will be used.
///
/// # Optional
///
/// This requires the optional `default-tls`, `native-tls`, or `rustls-tls(-...)`
/// feature to be enabled.
#[cfg(feature = "__tls")]
pub fn tls_built_in_root_certs(
self,
tls_built_in_root_certs: bool,
) -> ClientBuilder {
self.with_inner(move |inner| inner.tls_built_in_root_certs(tls_built_in_root_certs))
}
/// Sets the identity to be used for client certificate authentication.
#[cfg(feature = "__tls")]
pub fn identity(self, identity: Identity) -> ClientBuilder {