From: William Lallemand Date: Mon, 26 Jan 2026 13:19:19 +0000 (+0100) Subject: MINOR: ssl: display libssl errors on private key loading X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ebef67132c6238053b5f991e35cff7d17edb49b;p=thirdparty%2Fhaproxy.git MINOR: ssl: display libssl errors on private key loading Display a more precise error message from the libssl when a private key can't be loaded correctly. --- diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 749002b08..eb2e9cc84 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -628,8 +628,10 @@ int ssl_sock_load_key_into_ckch(const char *path, char *buf, struct ckch_data *d } while (!key && cb_data.passphrase_idx != -1 && cb_data.callback_called); if (key == NULL) { - memprintf(err, "%sunable to load private key from file '%s'.\n", - err && *err ? *err : "", path); + unsigned long e = ERR_peek_last_error(); + + memprintf(err, "%sunable to load private key from file '%s' (%s).\n", + err && *err ? *err : "", path, ERR_error_string(e, NULL)); goto end; }