title: Using CHttpFile with HTTPS sites
body: <p>I have this code that I use to read a data file from my website:</p>
  
  <pre><code>CInternetSession    iSession;
  CHttpFile           *pWebFile = nullptr;
  DWORD               dwStatusCode;
  CString             strError, strTargetZIP, strDownloadURL;
  
  strTargetZIP = theApp.GetWorkingPath() + _T("AutoUpdate\\MWBDataUpdate.zip");
  strDownloadURL = _T("http://www.publictalksoftware.co.uk/mwbdata/MWBDataUpdate.zip");
  
  // ask user to go online
  if (InternetGoOnline((LPTSTR)(LPCTSTR)strDownloadURL, hWnd, 0))
  {
      TRY
      {
          // our session should already be open
          // try to open up internet session to my URL
          // Use flag INTERNET_FLAG_RELOAD
          pWebFile = (CHttpFile*)iSession.OpenURL(strDownloadURL, 1,
          INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD);
  
          if (pWebFile != nullptr)
          {
              if (pWebFile-&gt;QueryInfoStatusCode(dwStatusCode))
              {
                  // 20x codes mean success
                  if ((dwStatusCode / 100) == 2)
                  {
                  }
                  else
                  {
                      // There was a problem!
                      strError.Format(IDS_TPL_INVALID_URL, dwStatusCode);
                      AfxMessageBox(strError, MB_OK | MB_ICONERROR);
                  }
              }
          }
          else
          {
              // Note, there is no error log.  Use new error message?
              AfxMessageBox(IDS_STR_UPDATE_CHECK_ERR, MB_OK | MB_ICONERROR);
          }
      }
      CATCH(CException, e)
      {
          e-&gt;GetErrorMessage(szError, _MAX_PATH);
          AfxMessageBox(szError, MB_OK | MB_ICONERROR);
      }
      END_CATCH
  
      // Tidy up
      if (pWebFile != nullptr)
      {
          pWebFile-&gt;Close();
          delete pWebFile;
      }
      iSession.Close();
  }
  </code></pre>
  
  <p>I have recently changed my site to use <code>HTTPS</code> and I am trying to find if all I need to do is just change the <code>URL</code> here in my code. I have looked up the latest documentation for <a href="https://docs.microsoft.com/en-gb/cpp/mfc/reference/chttpfile-class" rel="nofollow noreferrer"><code>CHttpFile</code></a> and it only mentions <code>HTTP</code>.</p>
  
  <p>Thanks for the clarification.</p>