]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: If certificate is empty, say it clearly in the error message
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Apr 2020 12:43:12 +0000 (15:43 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 24 Apr 2020 08:51:38 +0000 (08:51 +0000)
Instead of "There is no valid PEM certificate" just say
"The certificate is empty".

src/lib-ssl-iostream/iostream-openssl-common.c

index d79c986ed87ea3e1ef5ab2dfaf64e57e72147170..f02f6154714dc5a60d44ba1123ee577778723c12 100644 (file)
@@ -271,6 +271,9 @@ openssl_iostream_use_certificate_error(const char *cert, const char *set_name)
 {
        unsigned long err;
 
+       if (cert[0] == '\0')
+               return "The certificate is empty";
+
        err = ERR_peek_error();
        if (ERR_GET_LIB(err) != ERR_LIB_PEM ||
            ERR_GET_REASON(err) != PEM_R_NO_START_LINE)