]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login: Give a better error message if ssl_cert=path is attempted without '<'
authorTimo Sirainen <tss@iki.fi>
Mon, 4 Oct 2010 13:45:25 +0000 (14:45 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 4 Oct 2010 13:45:25 +0000 (14:45 +0100)
src/login-common/ssl-proxy-openssl.c

index 7f71dcc52be937e476faf61458a27414d82bc827..aeabe5b559987892d3b8f7c9a02c7ed6c14e4b77 100644 (file)
@@ -964,8 +964,11 @@ static const char *ssl_proxy_get_use_certificate_error(const char *cert)
        else if (is_pem_key(cert)) {
                return "The file contains a private key "
                        "(you've mixed ssl_cert and ssl_key settings)";
+       } else if (strchr(cert, '\n') == NULL) {
+               return t_strdup_printf("There is no valid PEM certificate. "
+                       "(You probably forgot '<' from ssl_cert=<%s)", cert);
        } else {
-               return "There is no certificate.";
+               return "There is no valid PEM certificate.";
        }
 }