Make it so we use system openssl under linux
This commit is contained in:
@@ -63,19 +63,24 @@ const char *dummy_key =
|
||||
|
||||
std::string errors_string(bool lastonly) {
|
||||
std::string err;
|
||||
const char *file, *data, *func;
|
||||
const char *file, *data;
|
||||
int line, flags;
|
||||
// const char *func;
|
||||
|
||||
while (true) {
|
||||
// Newer versions of the SSL API support this.
|
||||
// unsigned long code =
|
||||
// ERR_get_error_all(&file, &line, &func, &data, &flags);
|
||||
// Older versions of the SSL API support this.
|
||||
unsigned long code =
|
||||
ERR_get_error_all(&file, &line, &func, &data, &flags);
|
||||
ERR_get_error_line_data(&file, &line, &data, &flags);
|
||||
if (code == 0) break;
|
||||
std::string reason;
|
||||
if (ERR_SYSTEM_ERROR(code)) {
|
||||
reason = strerror_str(ERR_GET_REASON(code));
|
||||
const char *rc = ERR_reason_error_string(code);
|
||||
if (rc != nullptr) {
|
||||
reason = rc;
|
||||
} else {
|
||||
const char *rc = ERR_reason_error_string(code);
|
||||
reason = (rc == nullptr) ? "unknown" : rc;
|
||||
reason = "sys:" + strerror_str(ERR_GET_REASON(code));
|
||||
}
|
||||
if (err.empty() || lastonly) {
|
||||
err = reason;
|
||||
|
||||
Reference in New Issue
Block a user