use std::sync::Arc;
pub(crate) fn client_config() -> rustls::ClientConfig {
let mut roots = rustls::RootCertStore::empty();
roots.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
client_config_with_roots(roots)
}
pub(crate) fn client_config_with_roots(roots: rustls::RootCertStore) -> rustls::ClientConfig {
rustls::ClientConfig::builder_with_provider(Arc::new(rustls_rustcrypto::provider()))
.with_safe_default_protocol_versions()
.expect("the RustCrypto provider supports the default TLS protocol versions")
.with_root_certificates(roots)
.with_no_client_auth()
}
#[cfg(test)]
mod tests;