WinInet HTTP SDK have problem with dealing untrusted root CA Web Server
Posted on 2006-05-09
Firstly sorry to post non-MFC related question to this area, but it's most related area for WIN32 SDK.
I am have problem with HttpSendRequest when connecting to a secure web server but with unauthorized CA, I have set INTERNET_FLAG_IGNORE_CERT_CN_INVALID and INTERNET_FLAG_IGNORE_CERT_DATE_INVALID flags for HttpOpenRequest but it's giving me the error code 12045, which is ERROR_WINHTTP_SECURE_INVALID_CA, is there anything else I need to do before setting up the connection?
Following are my code fragment for HttpOpenRequest:
mConnectHandle = ::InternetConnect(mDownloadManager->mSessionHandle,
mHttpRequestHandle = ::HttpOpenRequest(mConnectHandle,
INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_SECURE | INTERNET_FLAG_IGNORE_CERT_CN_INVALID | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID,
thanks in advance.