Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-26 05:50:29 +01:00
Merge pull request #918 from dani-garcia/revert-901-feature/opportunistic_tls
Revert "Use opportunistic TLS in SMTP connections"
Dieser Commit ist enthalten in:
Commit
935f38692f
1 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen
20
src/mail.rs
20
src/mail.rs
|
@ -18,21 +18,21 @@ use chrono::NaiveDateTime;
|
||||||
fn mailer() -> SmtpTransport {
|
fn mailer() -> SmtpTransport {
|
||||||
let host = CONFIG.smtp_host().unwrap();
|
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 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() {
|
if CONFIG.smtp_explicit_tls() {
|
||||||
ClientSecurity::Wrapper(tls_params)
|
ClientSecurity::Wrapper(params)
|
||||||
} else {
|
} else {
|
||||||
ClientSecurity::Required(tls_params)
|
ClientSecurity::Required(params)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ClientSecurity::Opportunistic(tls_params)
|
ClientSecurity::None
|
||||||
};
|
};
|
||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
Laden …
In neuem Issue referenzieren