fix(tls): disable hostname checks in all cases

This commit is contained in:
dignifiedquire
2019-05-09 14:21:41 +01:00
parent 3a7dcd14ab
commit 2a4057a774
2 changed files with 12 additions and 6 deletions

View File

@@ -363,7 +363,11 @@ impl Imap {
if (server_flags & (DC_LP_IMAP_SOCKET_STARTTLS | DC_LP_IMAP_SOCKET_PLAIN)) != 0 {
imap::connect_insecure((imap_server, imap_port)).and_then(|client| {
if (server_flags & DC_LP_IMAP_SOCKET_STARTTLS) != 0 {
let tls = native_tls::TlsConnector::builder().build().unwrap();
let tls = native_tls::TlsConnector::builder()
// FIXME: unfortunately this is needed to make things work on macos + testrun.org
.danger_accept_invalid_hostnames(true)
.build()
.unwrap();
client.secure(imap_server, &tls).map(Into::into)
} else {
Ok(client.into())