public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common] certificate: actually print openssl errors
Date: Tue,  7 Mar 2023 11:50:18 +0100	[thread overview]
Message-ID: <20230307105018.3172827-1-f.gruenbichler@proxmox.com> (raw)

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





             reply	other threads:[~2023-03-07 10:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 10:50 Fabian Grünbichler [this message]
2023-03-11 17:26 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230307105018.3172827-1-f.gruenbichler@proxmox.com \
    --to=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal