Using <urlmon.h> and URLDownloadToFile to Get HTTPS Web Resources
All,
I am engaged in programming that can download content from various websites to my local network and disable it. For this, I have to use libs and C ++ for compatibility reasons. So far, I have been able to successfully access the regular HTTP page and HTTPS page on the Internet. Example:
HRESULT res = URLDownloadToFile( NULL, LPCTSTR(CString("https://www.google.com/")), LPCTSTR(CString("websitecontent.txt")), 0, NULL); There are two things that I cannot do: 1) Access to a LAN resource that uses a local CA certificate.
2) Gain access to a LAN resource that uses a local CA certificate and requests client authentication through a client certificate.
In the first case, I think that the windows do not allow the connection, because it is not in the list of trusted Windows CAs.
In the second, I think I need to figure out a way to integrate the client certificate / private key into the URLDownloadToFile call, but I don't know how to do this. In addition, I will also need to tell windows to trust the local CA.
Any help would be appreciated.