vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 935f38692f612e78f0d331e4b95af333c3806bd2
parent b85d548879204858325088fa1048e0b6b185600c
Author: Daniel GarcĂ­a <dani-garcia@users.noreply.github.com>
Date:   Thu, 19 Mar 2020 13:58:00 +0100

Merge pull request #918 from dani-garcia/revert-901-feature/opportunistic_tls

Revert "Use opportunistic TLS in SMTP connections"
Diffstat:
Msrc/mail.rs | 18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mail.rs b/src/mail.rs @@ -18,21 +18,21 @@ use chrono::NaiveDateTime; fn mailer() -> SmtpTransport { let host = CONFIG.smtp_host().unwrap(); - let tls = TlsConnector::builder() - .min_protocol_version(Some(Protocol::Tlsv11)) - .build() - .unwrap(); + let client_security = if CONFIG.smtp_ssl() { + let tls = TlsConnector::builder() + .min_protocol_version(Some(Protocol::Tlsv11)) + .build() + .unwrap(); - let tls_params = ClientTlsParameters::new(host.clone(), tls); + let params = ClientTlsParameters::new(host.clone(), tls); - let client_security = if CONFIG.smtp_ssl() { if CONFIG.smtp_explicit_tls() { - ClientSecurity::Wrapper(tls_params) + ClientSecurity::Wrapper(params) } else { - ClientSecurity::Required(tls_params) + ClientSecurity::Required(params) } } else { - ClientSecurity::Opportunistic(tls_params) + ClientSecurity::None }; use std::time::Duration;