Display a more precise error message from the libssl when a private key
can't be loaded correctly.
} while (!key && cb_data.passphrase_idx != -1 && cb_data.callback_called);
if (key == NULL) {
- memprintf(err, "%sunable to load private key from file '%s'.\n",
- err && *err ? *err : "", path);
+ unsigned long e = ERR_peek_last_error();
+
+ memprintf(err, "%sunable to load private key from file '%s' (%s).\n",
+ err && *err ? *err : "", path, ERR_error_string(e, NULL));
goto end;
}