In some circumstances (e.g. when proxies are involved), winhttp will fail to reach the WINHTTP_CALLBACK_STATUS_SENDING_REQUEST phase. If this occurs, we'll error with ERROR_WINHTTP_INCORRECT_HANDLE_STATE when attempting to query the server certificate context (see https://docs.microsoft.com/en-us/windows/win32/api/winhttp/nf-winhttp-winhttpsendrequest#remarks). To avoid this, verify that WinHttpSendRequest has reached the WINHTTP_CALLBACK_STATUS_SENDING_REQUEST phase before checking the certificate. Since we're using WinHTTP in synchronous mode, we know for sure that once WinHttpSendRequest returns we've either sent it successfully or not. NOTE: WINHTTP_CALLBACK_STATUS_SENDING_REQUEST appears to be deprecated with no direct replacement. WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE is only available in async mode, and there doesn't appear to be a method of querying this flag outside of the status callback.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
auth.c | Loading commit data... | |
auth.h | Loading commit data... | |
auth_negotiate.c | Loading commit data... | |
auth_negotiate.h | Loading commit data... | |
auth_ntlm.c | Loading commit data... | |
auth_ntlm.h | Loading commit data... | |
credential.c | Loading commit data... | |
credential_helpers.c | Loading commit data... | |
git.c | Loading commit data... | |
http.c | Loading commit data... | |
http.h | Loading commit data... | |
httpclient.c | Loading commit data... | |
httpclient.h | Loading commit data... | |
local.c | Loading commit data... | |
smart.c | Loading commit data... | |
smart.h | Loading commit data... | |
smart_pkt.c | Loading commit data... | |
smart_protocol.c | Loading commit data... | |
ssh.c | Loading commit data... | |
ssh.h | Loading commit data... | |
winhttp.c | Loading commit data... |