Add support for insecure certs for SMTPS

This commit is contained in:
ViViDboarder 2019-08-23 11:54:56 -07:00
parent 026f9da035
commit c50a90a1f2
2 changed files with 3 additions and 0 deletions

View File

@ -345,6 +345,8 @@ make_config! {
smtp_username: String, true, option; smtp_username: String, true, option;
/// Password /// Password
smtp_password: Pass, true, option; smtp_password: Pass, true, option;
/// Accept invalid certificates
smtp_ssl_insecure: bool, true, def, false;
}, },
} }

View File

@ -18,6 +18,7 @@ fn mailer() -> SmtpTransport {
let client_security = if CONFIG.smtp_ssl() { let client_security = if CONFIG.smtp_ssl() {
let tls = TlsConnector::builder() let tls = TlsConnector::builder()
.min_protocol_version(Some(Protocol::Tlsv11)) .min_protocol_version(Some(Protocol::Tlsv11))
.danger_accept_invalid_certs(CONFIG.smtp_ssl_insecure())
.build() .build()
.unwrap(); .unwrap();