From 59d8d70b83b7b153155c4bf530cd3068fabd90db Mon Sep 17 00:00:00 2001 From: "Simon.Dean" Date: Fri, 11 Feb 2022 10:19:33 +0000 Subject: [PATCH] Add SSL Error Logging --- src/Transport/SSLWrapper.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Transport/SSLWrapper.cpp b/src/Transport/SSLWrapper.cpp index 6aca9b4..f07f983 100644 --- a/src/Transport/SSLWrapper.cpp +++ b/src/Transport/SSLWrapper.cpp @@ -22,7 +22,7 @@ #include #include #include - +#include namespace aasdk { @@ -48,6 +48,8 @@ SSLWrapper::~SSLWrapper() ERR_remove_state(0); #endif ERR_free_strings(); + ERR_load_crypto_strings(); + ERR_load_ERR_strings(); } X509* SSLWrapper::readCertificate(const std::string& certificate) @@ -187,6 +189,9 @@ int SSLWrapper::sslWrite(SSL *ssl, const void *buf, int num) int SSLWrapper::getError(SSL* ssl, int returnCode) { + while (auto err = ERR_get_error()) { + AASDK_LOG(error) << "[SSLWrapper] SSL Error " << ERR_error_string(err, NULL); + } return SSL_get_error(ssl, returnCode); }