From 0bda45be464cf31c46ad7a2436c9472c52c8d6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 7 Mar 2023 11:50:18 +0100 Subject: [PATCH] certificate: actually print openssl errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit print_errs (which is also called internally by die_now) will only 'warn' the collected error stack if the log level is set to tracing. otherwise, it will just return the error message(s) corresponding to the error stack as string. while they are not always the most user-friendly ones, they do provide additional context that might help to find out what is actually causing a particular failure. both helpers here actually provide a meaninful user friendly context (via $msg) as final line. Signed-off-by: Fabian Grünbichler [ T: resolve merge conflict due to dropped warn helper ] Signed-off-by: Thomas Lamprecht --- src/PVE/Certificate.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/Certificate.pm b/src/PVE/Certificate.pm index 13ecb57..4ce7364 100644 --- a/src/PVE/Certificate.pm +++ b/src/PVE/Certificate.pm @@ -173,6 +173,7 @@ sub der_to_pem { my sub ssl_die { my ($msg) = @_; + warn Net::SSLeay::print_errs(); Net::SSLeay::die_now("$msg\n"); };