Skip to content

Commit

Permalink
lib-smtp: client: Fix ignoring invalid certificate from server.
Browse files Browse the repository at this point in the history
Although it initially allowed the invalid certificate, it would still fail later
on while reading/writing the SSL streams.
  • Loading branch information
stephanbosch committed Jan 25, 2018
1 parent 54d0a5a commit 1dd3082
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lib-smtp/smtp-client-connection.c
Expand Up @@ -1201,7 +1201,6 @@ static int
smtp_client_connection_ssl_init(struct smtp_client_connection *conn,
const char **error_r)
{
struct ssl_iostream_settings ssl_set;
const char *error;

if (smtp_client_connection_init_ssl_ctx(conn, &error) < 0) {
Expand All @@ -1210,11 +1209,6 @@ smtp_client_connection_ssl_init(struct smtp_client_connection *conn,
return -1;
}

i_zero(&ssl_set);
if (!conn->set.ssl->allow_invalid_cert) {
ssl_set.verbose_invalid_cert = TRUE;
}

if (conn->set.debug)
smtp_client_connection_debug(conn, "Starting SSL handshake");

Expand All @@ -1229,7 +1223,7 @@ smtp_client_connection_ssl_init(struct smtp_client_connection *conn,
}

if (io_stream_create_ssl_client(conn->ssl_ctx,
conn->host, &ssl_set,
conn->host, conn->set.ssl,
&conn->conn.input, &conn->conn.output,
&conn->ssl_iostream, &error) < 0) {
*error_r = t_strdup_printf(
Expand Down

0 comments on commit 1dd3082

Please sign in to comment.