Add Log output for SSLWraper getError()

pull/14/head
Simon.Dean 2022-01-31 13:47:03 +00:00
parent 1d46df4883
commit c3f6a2887f
1 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <openssl/ssl.h>
#include <openssl/conf.h>
#include <f1x/aasdk/Transport/SSLWrapper.hpp>
#include <f1x/aasdk/Common/Log.hpp>
namespace f1x
{
@ -49,6 +50,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)
@ -188,6 +191,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);
}