You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Revert "Skip certificate chain validation when sending emails"
This reverts commit af4f19df7b
.
This commit is contained in:
@ -75,30 +75,8 @@ impl Transport {
|
|||||||
) -> Result<Self, lettre::transport::smtp::Error> {
|
) -> Result<Self, lettre::transport::smtp::Error> {
|
||||||
let mut t = match mode {
|
let mut t = match mode {
|
||||||
SmtpMode::Plain => AsyncSmtpTransport::<Tokio1Executor>::builder_dangerous(hostname),
|
SmtpMode::Plain => AsyncSmtpTransport::<Tokio1Executor>::builder_dangerous(hostname),
|
||||||
SmtpMode::StartTls => {
|
SmtpMode::StartTls => AsyncSmtpTransport::<Tokio1Executor>::starttls_relay(hostname)?,
|
||||||
let tls_parameters =
|
SmtpMode::Tls => AsyncSmtpTransport::<Tokio1Executor>::relay(hostname)?,
|
||||||
lettre::transport::smtp::client::TlsParameters::builder(hostname.to_owned())
|
|
||||||
.dangerous_accept_invalid_certs(true)
|
|
||||||
.build()?;
|
|
||||||
|
|
||||||
AsyncSmtpTransport::<Tokio1Executor>::builder_dangerous(hostname)
|
|
||||||
.port(lettre::transport::smtp::SUBMISSION_PORT)
|
|
||||||
.tls(lettre::transport::smtp::client::Tls::Required(
|
|
||||||
tls_parameters,
|
|
||||||
))
|
|
||||||
}
|
|
||||||
SmtpMode::Tls => {
|
|
||||||
let tls_parameters =
|
|
||||||
lettre::transport::smtp::client::TlsParameters::builder(hostname.to_owned())
|
|
||||||
.dangerous_accept_invalid_certs(true)
|
|
||||||
.build()?;
|
|
||||||
|
|
||||||
AsyncSmtpTransport::<Tokio1Executor>::builder_dangerous(hostname)
|
|
||||||
.port(lettre::transport::smtp::SUBMISSIONS_PORT)
|
|
||||||
.tls(lettre::transport::smtp::client::Tls::Wrapper(
|
|
||||||
tls_parameters,
|
|
||||||
))
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(credentials) = credentials {
|
if let Some(credentials) = credentials {
|
||||||
|
Reference in New Issue
Block a user