none
How to use URLDownloadToFile on HTTPS connections? RRS feed

  • Question

  • Hello,

    I would like to download a file from a secured SSL connection using URLDownloadToFile.

    I have everything in place (a callback too) and downloading from the same site "http://httpd.apache.org/test/" works. Just not from the Secured site at "https://httpd.apache.org/test/".

    The returned error code in OnStopBinding is 0x800c000e.

     

    Any ideas? Are the some flags I need to set in my handlers BindInfo method?

     

    Thanks,

    Phil

    Wednesday, June 16, 2010 3:13 AM

All replies

  • That error code is:

    Include\UrlMon.h:502:#define INET_E_SECURITY_PROBLEM          _HRESULT_TYPEDEF_(0x800C000EL)

    So, you're probably just not authenticated?  Not sure how you do that.  

    Thursday, June 17, 2010 7:44 PM
  • Yes, I solved the problem. URLmon could not display a message and therefor failed. Once I gave it a window handle it works. The certificate used at apache is invalid.
    Friday, June 18, 2010 12:25 PM
  • Hi, I  am facing same problem . can you elaborate more ? How you have handled certificate ?
    Friday, July 16, 2010 11:21 AM
  • I implemented the IHttpSecurity::OnSecurityProblem and returned S_FALSE which will cause URLMon to display a window with the error message about the certificate.

    In your IWindowForBindingUI::GetWindow you can return NULL as the window handle (which means use the desktop window).

    This should at least display the reason why the download failed.

    Friday, July 16, 2010 11:48 AM
  • Hello Phil, 

    Can you pls provide code example how to implement this? I'm using the URLDownloadToFile but server has invalid SSL certificate and I'm trying to simply bypass it or turn the SSL certificate check off. 

    Thank you 

    Jan 

    Saturday, September 15, 2012 11:32 AM
  • Hi phil!

    I know.. this from thread is too old. But I have question.

    My full code is here: https://hastebin.com/lugusizovi.cpp - full because I want really help.

    I have problem with URLDownloadToFile

    If I debugging that I tried http and https URL but does not works..

    Name Value Type
    res 0x800c000d : The specified protocol is unknown. HRESULT
    url 0x00007ff704ba2d40 "" const char *
    0 '\0' const char

    Sunday, November 18, 2018 8:40 AM
  • your URL is an empty string.
    Sunday, November 18, 2018 1:43 PM