Skip to content

Commit

Permalink
Load OpenSSL error strings (#6800)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyashton authored Feb 4, 2025
1 parent 36da4c0 commit efcab26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/crypto/openssl/openssl_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ namespace ccf::crypto
if (ec)
{
std::string err(256, '\0');
ERR_load_crypto_strings();
SSL_load_error_strings();
ERR_error_string_n((unsigned long)ec, err.data(), err.size());
ERR_free_strings();
// Remove any trailing NULs before returning
err.resize(std::strlen(err.c_str()));
return err;
Expand Down

0 comments on commit efcab26

Please sign in to comment.