all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] certificate: actually print openssl errors
@ 2023-03-07 10:50 Fabian Grünbichler
  2023-03-11 17:26 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2023-03-07 10:50 UTC (permalink / raw)
  To: pve-devel

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>
---

Notes:
    noticed while testing Max' key check series

 src/PVE/Certificate.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Certificate.pm b/src/PVE/Certificate.pm
index 73091ff..3322557 100644
--- a/src/PVE/Certificate.pm
+++ b/src/PVE/Certificate.pm
@@ -181,12 +181,13 @@ sub der_to_pem {
 
 my $ssl_die = sub {
     my ($msg) = @_;
+    warn Net::SSLeay::print_errs();
     Net::SSLeay::die_now($msg);
 };
 
 my $ssl_warn = sub {
     my ($msg) = @_;
-    Net::SSLeay::print_errs();
+    warn Net::SSLeay::print_errs();
     warn $msg if $msg;
 };
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-11 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 10:50 [pve-devel] [PATCH common] certificate: actually print openssl errors Fabian Grünbichler
2023-03-11 17:26 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal