diff --git a/Cargo.toml b/Cargo.toml index 6f56f10..bb047ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,3 +93,6 @@ uuid = { version = "1.10.0", features = ["v7"] } vrl = { version = "0.19.0", default-features = false, features = ["value"] } x509-parser = "0.16.0" zeroize = { version = "1.8.1", features = ["derive"] } + +[target.'cfg(not(target_os = "macos"))'.dependencies] +webpki-roots = "0.26.6" diff --git a/src/tls/mod.rs b/src/tls/mod.rs index bf86a47..11038fc 100644 --- a/src/tls/mod.rs +++ b/src/tls/mod.rs @@ -201,15 +201,13 @@ pub fn prepare_client_config(tls_versions: &[&'static SupportedProtocolVersion]) // new_with_extra_roots() method isn't available on MacOS, see // https://github.com/rustls/rustls-platform-verifier/issues/58 #[cfg(not(target_os = "macos"))] - let verifier = Arc::new(Verifier::new_with_extra_roots( - webpki_roots::TLS_SERVER_ROOTS.to_vec(), - )); + let verifier = Verifier::new_with_extra_roots(webpki_roots::TLS_SERVER_ROOTS.to_vec()).unwrap(); #[cfg(target_os = "macos")] - let verifier = Arc::new(Verifier::new()); + let verifier = Verifier::new(); let mut cfg = ClientConfig::builder_with_protocol_versions(tls_versions) .dangerous() // Nothing really dangerous here - .with_custom_certificate_verifier(verifier) + .with_custom_certificate_verifier(Arc::new(verifier)) .with_no_client_auth(); // Session resumption