aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel GarcĂ­a <[email protected]>2020-03-19 13:56:53 +0100
committerGitHub <[email protected]>2020-03-19 13:56:53 +0100
commitd2d9fb08cc6de0d69e895b854837b3853fd5baf3 (patch)
tree4a36e8d5d99963d919850fd0a235213cc3ba1728
parentb85d548879204858325088fa1048e0b6b185600c (diff)
downloadvaultwarden-d2d9fb08cc6de0d69e895b854837b3853fd5baf3.tar.gz
vaultwarden-d2d9fb08cc6de0d69e895b854837b3853fd5baf3.zip
Revert "Use opportunistic TLS in SMTP connections"
-rw-r--r--src/mail.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mail.rs b/src/mail.rs
index 699bd156..2878ed83 100644
--- 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;