Skip to content

WinHTTP: set proper error messages when SSL fails#4050

Merged
carlosmn merged 1 commit into
libgit2:masterfrom
ethomson:ethomson/winhttp_errmsgs
Jan 24, 2017
Merged

WinHTTP: set proper error messages when SSL fails#4050
carlosmn merged 1 commit into
libgit2:masterfrom
ethomson:ethomson/winhttp_errmsgs

Conversation

@ethomson
Copy link
Copy Markdown
Member

When SSL fails for the WinHTTP transport, by default we set the error message to the most unhelpful "user cancelled certificate check", which is set when there is no giterr set, even when there is no user certificate check configured.

Instead, try to capture the SSL failure to provide a more helpful error message by setting a status callback and looking for security failures (WINHTTP_CALLBACK_STATUS_SECURE_FAILURE), and providing a helpful error message for them.

If the security failure is not reported, and there is no user certificate check, update the error message to not suggest that the (nonexistent) user certificate check is at fault.

@ethomson ethomson force-pushed the ethomson/winhttp_errmsgs branch from b0e778a to 8730c65 Compare December 30, 2016 17:46
Set up a WinHTTP status callback; inspect the WinHTTP status for
WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, and convert the status code
to a useful message for callers.
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