From: Otto Date: Fri, 24 Sep 2021 12:40:57 +0000 (+0200) Subject: Better error messages X-Git-Tag: auth-4.6.0-alpha1~21^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a76c33e48e3fd7b639ae7c4f446a95163f4e8ab2;p=thirdparty%2Fpdns.git Better error messages --- diff --git a/pdns/libssl.cc b/pdns/libssl.cc index 076a8d39bc..1f67eabb57 100644 --- a/pdns/libssl.cc +++ b/pdns/libssl.cc @@ -21,6 +21,8 @@ #include #endif /* HAVE_LIBSODIUM */ +#include "misc.hh" + #if (OPENSSL_VERSION_NUMBER < 0x1010000fL || (defined LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2090100fL) /* OpenSSL < 1.1.0 needs support for threading/locking in the calling application. */ @@ -782,12 +784,13 @@ std::unique_ptr libssl_set_key_log_file(std::unique_ptr(fdopen(fd, "a"), fclose); if (!fp) { + int error = errno; // close might clobber errno close(fd); - throw std::runtime_error("Error opening TLS log file '" + logFile + "'"); + throw std::runtime_error("Error opening TLS log file '" + logFile + "': " + stringerror(error)); } SSL_CTX_set_ex_data(ctx.get(), s_keyLogIndex, fp.get());