title: Using <urlmon.h> and URLDownloadToFile to get HTTPS Web Resources
body: <p>All,</p>
  
  <p>I am making a programming that will be able to download content from various websites on and off of my local network.To do this, I must use the  libs and c++ for compatibility reasons. So far I have been able to successfully access a normal HTTP page, and an HTTPS page on the web. Example:</p>
  
  <pre><code> HRESULT res = URLDownloadToFile( NULL,
            LPCTSTR(CString("https://www.google.com/")),
            LPCTSTR(CString("websitecontent.txt")),
            0,
            NULL);
  </code></pre>
  
  <p>There are two things I am unable to do:
  1) Access a local network resource that uses a local CA cert.</p>
  
  <p>2) Access a local network resource that uses a local CA cert and requests client authentication via client certificate.</p>
  
  <p>In the first case I think that windows is disallowing the connection because it is not on a windows list of trusted CA's. </p>
  
  <p>In the second I think I need to figure out a way to integrate a client cert/private key into the call to URLDownloadToFile but I don't know how to accomplish this. In addition, I would also have to tell windows to trust the local CA.</p>
  
  <p>Any help would be appreciated.</p>