From 0385ca3b194c7b984298d18cf26e008796a1fb33 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Fri, 2 May 2025 05:26:18 +0200 Subject: [PATCH] deprecations --- src/transport/smtp/client/mod.rs | 1 + src/transport/smtp/client/tls/deprecated.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/transport/smtp/client/mod.rs b/src/transport/smtp/client/mod.rs index e49fec3..bd79d64 100644 --- a/src/transport/smtp/client/mod.rs +++ b/src/transport/smtp/client/mod.rs @@ -36,6 +36,7 @@ use self::net::NetworkStream; #[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))] pub(super) use self::tls::deprecated::InnerTlsParameters; #[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))] +#[allow(deprecated)] pub use self::tls::deprecated::TlsVersion; #[allow(deprecated)] pub use self::{ diff --git a/src/transport/smtp/client/tls/deprecated.rs b/src/transport/smtp/client/tls/deprecated.rs index a7f5ff9..14989f5 100644 --- a/src/transport/smtp/client/tls/deprecated.rs +++ b/src/transport/smtp/client/tls/deprecated.rs @@ -7,6 +7,7 @@ use crate::transport::smtp::{error, Error}; #[derive(Debug, Copy, Clone)] #[non_exhaustive] #[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))] +#[deprecated] pub enum TlsVersion { /// TLS 1.0 /// @@ -157,11 +158,14 @@ pub struct TlsParametersBuilder { domain: String, #[allow(deprecated)] cert_store: CertificateStore, + #[allow(deprecated)] root_certs: Vec, + #[allow(deprecated)] identity: Option, accept_invalid_hostnames: bool, accept_invalid_certs: bool, #[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))] + #[allow(deprecated)] min_tls_version: TlsVersion, } @@ -473,6 +477,7 @@ impl TlsParameters { /// A certificate that can be used with [`TlsParametersBuilder::add_root_certificate`] #[derive(Clone)] #[allow(missing_copy_implementations)] +#[deprecated] pub struct Certificate { #[cfg(feature = "native-tls")] native_tls: super::native_tls::Certificate, @@ -483,6 +488,7 @@ pub struct Certificate { } #[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))] +#[allow(deprecated)] impl Certificate { /// Create a `Certificate` from a DER encoded certificate pub fn from_der(der: Vec) -> Result { @@ -519,6 +525,7 @@ impl Certificate { } } +#[allow(deprecated)] impl Debug for Certificate { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Certificate").finish() @@ -528,6 +535,7 @@ impl Debug for Certificate { /// An identity that can be used with [`TlsParametersBuilder::identify_with`] #[derive(Clone)] #[allow(missing_copy_implementations)] +#[deprecated] pub struct Identity { #[cfg(feature = "native-tls")] native_tls: super::native_tls::Identity, @@ -537,6 +545,7 @@ pub struct Identity { boring_tls: super::boring_tls::Identity, } +#[allow(deprecated)] impl Debug for Identity { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Identity").finish() @@ -544,6 +553,7 @@ impl Debug for Identity { } #[cfg(any(feature = "native-tls", feature = "rustls", feature = "boring-tls"))] +#[allow(deprecated)] impl Identity { pub fn from_pem(pem: &[u8], key: &[u8]) -> Result { Ok(Self {