Skip to content

Commit

Permalink
fix(smtp): use DNS cache for implicit TLS connections
Browse files Browse the repository at this point in the history
load_cache argument to connect_tcp() should only be false
if strict TLS checks are disabled or TLS is not used.
  • Loading branch information
link2xt committed Jul 25, 2024
1 parent 5fb5fd4 commit d46f53a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/smtp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Smtp {
port: u16,
strict_tls: bool,
) -> Result<SmtpTransport<Box<dyn SessionBufStream>>> {
let tcp_stream = connect_tcp(context, hostname, port, SMTP_TIMEOUT, false).await?;
let tcp_stream = connect_tcp(context, hostname, port, SMTP_TIMEOUT, strict_tls).await?;
let tls_stream = wrap_tls(strict_tls, hostname, &["smtp"], tcp_stream).await?;
let buffered_stream = BufStream::new(tls_stream);
let session_stream: Box<dyn SessionBufStream> = Box::new(buffered_stream);
Expand Down

0 comments on commit d46f53a

Please sign in to comment.