diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 40d3cf347..f947961b0 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -633,7 +633,7 @@ int ssl_sock_load_pem_into_ckch(const char *path, char *buf, struct cert_key_and } ret = ERR_get_error(); - if (ret && (ERR_GET_REASON(ret) != PEM_R_NO_START_LINE)) { + if (ret && !(ERR_GET_LIB(ret) == ERR_LIB_PEM && ERR_GET_REASON(ret) == PEM_R_NO_START_LINE)) { memprintf(err, "%sunable to load certificate chain from file '%s': %s\n", err && *err ? *err : "", path, ERR_reason_error_string(ret)); goto end;