Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show low-level error message for OpenSSL errors #1546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vadz
Copy link
Contributor

@vadz vadz commented Dec 10, 2020

Such errors may contain valuable information and we shouldn't just lose
it completely as happened before.


This is as simple as it gets, but allows to see messages like "Error in SSL handshake (certificate verify failed)" instead of just the part before the parentheses, which can be pretty invaluable when trying to diagnose a problem (in this case due to a proxy mounting a MitM attack on the connection...). Perhaps the error message should be included for other errors too, but it definitely should be done for those ones.

Such errors may contain valuable information and we shouldn't just lose
it completely as happened before.
if (ec.category() == boost::asio::error::ssl_category ||
ec.category() == boost::asio::ssl::error::stream_category)
{
message += " (";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message += " (" + ec.message() + ")";

seems more clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants