Description
We've seen occurrences where the following log entry was added to the logs:
LOG_WARNING("{}: ERROR: SSL_read returned -1 with error {}",
|
getId(),
|
error);
|
We should extent the log information to try to map the error code to a readable string:
try {
|
std::string errmsg("SSL_read() returned " +
|
std::to_string(n) + " with error " +
|
std::to_string(ssl.getError(n)));
|
std::vector<char> ssl_err(1024);
|
ERR_error_string_n(ERR_get_error(),
|
ssl_err.data(),
|
ssl_err.size());
|
LOG_WARNING("{}: {}: {}", getId(), errmsg, ssl_err.data());
|
} catch (const std::bad_alloc&) {
|
LOG_WARNING("{}: ERROR: SSL_read returned -1 with error {}",
|
getId(),
|
error);
|
}
|
This would (hopefully) aid customers if figuring what's wrong with their SSL configuration.