From: Aki Tuomi Date: Fri, 28 Apr 2017 17:28:23 +0000 (+0300) Subject: passdb-imap: Add option to control certificate verification X-Git-Tag: 2.3.0.rc1~1662 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6c725b360f5ccaa6a21ca79d027b6208c2b09bf;p=thirdparty%2Fdovecot%2Fcore.git passdb-imap: Add option to control certificate verification Turn it on by default --- diff --git a/src/auth/passdb-imap.c b/src/auth/passdb-imap.c index 9e18a4cb43..a6e562c315 100644 --- a/src/auth/passdb-imap.c +++ b/src/auth/passdb-imap.c @@ -151,6 +151,7 @@ passdb_imap_preinit(pool_t pool, const char *args) module->set.ssl_mode = IMAPC_CLIENT_SSL_MODE_NONE; module->set.username = "%u"; module->set.rawlog_dir = ""; + module->set.ssl_verify = TRUE; for (tmp = p_strsplit(pool, args, " "); *tmp != NULL; tmp++) { key = *tmp; @@ -184,6 +185,15 @@ passdb_imap_preinit(pool_t pool, const char *args) i_fatal("passdb imap: Invalid ssl mode: %s", value); } + } else if (strcmp(key, "allow_invalid_cert") == 0) { + if (strcmp(value, "yes") == 0) { + module->set.ssl_verify = FALSE; + } else if (strcmp(value, "no") == 0) { + module->set.ssl_verify = TRUE; + } else { + i_fatal("passdb imap: Invalid allow_invalid_cert value: %s", + value); + } } else { i_fatal("passdb imap: Unknown parameter: %s", key); }