]> git.proxmox.com Git - pve-common.git/commitdiff
certificate: actually print openssl errors
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 7 Mar 2023 10:50:18 +0000 (11:50 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 11 Mar 2023 17:25:04 +0000 (18:25 +0100)
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 <f.gruenbichler@proxmox.com>
 [ T: resolve merge conflict due to dropped warn helper ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Certificate.pm

index 13ecb575d45db1bf68d80486d85800daee422e64..4ce73645a9c57407ae2abe8e0d9606fe7242d527 100644 (file)
@@ -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");
 };