From 5f7063fdc374c21141e727df86edfd1a7703ec31 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Tue, 24 Oct 2023 22:54:22 +0200 Subject: [PATCH] Fix accidental disabling of webpki-roots setup (#909) --- src/transport/smtp/client/tls.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/transport/smtp/client/tls.rs b/src/transport/smtp/client/tls.rs index 4894371..cab9035 100644 --- a/src/transport/smtp/client/tls.rs +++ b/src/transport/smtp/client/tls.rs @@ -115,7 +115,7 @@ pub enum CertificateStore { /// Use a hardcoded set of Mozilla roots via the `webpki-roots` crate. /// /// This option is only available in the rustls backend. - #[cfg(feature = "webpki-roots")] + #[cfg(feature = "rustls-tls")] WebpkiRoots, /// Don't use any system certificates. None, @@ -384,9 +384,9 @@ impl TlsParametersBuilder { Ok(()) } - #[cfg(feature = "webpki-roots")] + #[cfg(feature = "rustls-tls")] fn load_webpki_roots(store: &mut RootCertStore) { - store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { + store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( ta.subject, ta.spki, @@ -399,10 +399,10 @@ impl TlsParametersBuilder { CertificateStore::Default => { #[cfg(feature = "rustls-native-certs")] load_native_roots(&mut root_cert_store)?; - #[cfg(all(not(feature = "rustls-native-certs"), feature = "webpki-roots"))] + #[cfg(not(feature = "rustls-native-certs"))] load_webpki_roots(&mut root_cert_store); } - #[cfg(feature = "webpki-roots")] + #[cfg(feature = "rustls-tls")] CertificateStore::WebpkiRoots => { load_webpki_roots(&mut root_cert_store); }