mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-11-22 23:26:22 +01:00
Revert "Use opportunistic TLS in SMTP connections"
This commit is contained in:
parent
b85d548879
commit
d2d9fb08cc
1 changed files with 10 additions and 10 deletions
20
src/mail.rs
20
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 tls_params = ClientTlsParameters::new(host.clone(), tls);
|
||||
|
||||
let client_security = if CONFIG.smtp_ssl() {
|
||||
let tls = TlsConnector::builder()
|
||||
.min_protocol_version(Some(Protocol::Tlsv11))
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
let params = ClientTlsParameters::new(host.clone(), tls);
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue