Skip to content

Commit

Permalink
Merge e0b802a into a440ae5
Browse files Browse the repository at this point in the history
  • Loading branch information
OJFord committed Feb 14, 2020
2 parents a440ae5 + e0b802a commit 24e573b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/smtp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ use native_tls::{Protocol, TlsConnector};
use rustls::ClientConfig;
use std::net::{SocketAddr, ToSocketAddrs};
use std::time::Duration;
#[cfg(feature = "rustls")]
use webpki_roots::TLS_SERVER_ROOTS;

pub mod authentication;
pub mod client;
Expand Down Expand Up @@ -158,7 +160,12 @@ impl SmtpClient {

#[cfg(feature = "rustls")]
pub fn new_simple(domain: &str) -> Result<SmtpClient, Error> {
let tls_parameters = ClientTlsParameters::new(domain.to_string(), ClientConfig::new());
let mut tls = ClientConfig::new();
tls.config
.root_store
.add_server_trust_anchors(&TLS_SERVER_ROOTS);

let tls_parameters = ClientTlsParameters::new(domain.to_string(), tls);

SmtpClient::new(
(domain, SUBMISSIONS_PORT),
Expand Down

0 comments on commit 24e573b

Please sign in to comment.