dcsimg
Results 1 to 12 of 12

Thread: Download File from https server using winhttp

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    276

    Download File from https server using winhttp

    Hello group,

    Having an issue, I recently had to switch my servers to https /ssl

    Inside my vb app I need to download files, which used to work even on with .htaccess file fowarding to https

    A few days ago it stopped working.

    Code:
    Public Sub downloadTheFile(theFile As String, aSynch As Boolean)
      
        ' Create the WinHTTPRequest ActiveX Object.
        Set http = New WinHttp.WinHttpRequest
       
        ''set to ignore certificate warnings
        http.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
        
        ' Open an HTTP connection.
        http.Open "GET", theFile, aSynch  'True means asynch.
       
        ' Send the HTTP Request.
        http.send
        
    End Sub
    I get -2147012867 A connection with the server could not be established error.

    I have a temp work around where my .htaccess file excludes the download folders but I would like to winHttp to download from ssl secured servers.

    Any Ideas?

  2. #2
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    684

    Re: Download File from https server using winhttp

    Which SSL are enforcing your webserver? SSL1 SSL2 SSL3? if the machine where you are running the program don't have some specific SSL updates for IExplorer, and your webserver is using ssl2 or 3, your VB program will not work.

    By example, in my program, it is mandatory to have IE10 or IE11 full updated.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    276

    Re: Download File from https server using winhttp

    flyguille,

    thanks. Yes it appears its an issue on my windows 7 machines but not my windows 10 . There is no way for me to force users to update IE11, most only use chrome anyway. Any other option?

    WP

  4. #4
    Member Grant Swinger's Avatar
    Join Date
    Jul 2015
    Posts
    33

    Re: Download File from https server using winhttp

    Are you sure your customers don't have IE11 anyway? Microsoft has been pushing it out through Microsoft Update for some time now. If their machines are up to date they should have it even if they don't use it.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    276

    Re: Download File from https server using winhttp

    My machine has received all updates, running windows 7 and it still has the issue.

    WP

  6. #6
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    684

    Re: Download File from https server using winhttp

    Quote Originally Posted by axisdj View Post
    flyguille,

    thanks. Yes it appears its an issue on my windows 7 machines but not my windows 10 . There is no way for me to force users to update IE11, most only use chrome anyway. Any other option?

    WP
    so, make sure your webserver will use old and insecure old SSL.

  7. #7
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    684

    Re: Download File from https server using winhttp

    Quote Originally Posted by flyguille View Post
    so, make sure your webserver will use old and insecure old SSL.
    So, you has a win10 machine which work, but not the win7, there is a package from microsft for win7 to update the ssl support, you can redistribute it.

    check out about this.

    http://www.catalog.update.microsoft....px?q=kb3140245

  8. #8
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,442

    Re: Download File from https server using winhttp

    I've had this issue in the past and took me sometime to really figure out what was happening.
    Depending on what type of SSL certificate the website has i.e 128bit vs 256bit then you need to also adjust TLS settings.
    The issue would be happening with Win7 + Win 8. Win10 has these settings on by default.

    The way to fix it, is to go to Internet Explorer>>Options>>>Advanced and make sure the following are selected:
    Name:  tls_en2.jpg
Views: 139
Size:  155.9 KB
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,244

    Re: Download File from https server using winhttp

    WinHttp does not use the same components as IE. About all they might have in common related to this is in Schannel, but their option settings for cipher suites in use are in different parts of the registry.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    276

    Re: Download File from https server using winhttp

    Quote Originally Posted by dilettante View Post
    WinHttp does not use the same components as IE. About all they might have in common related to this is in Schannel, but their option settings for cipher suites in use are in different parts of the registry.
    Yes, I have tried all options above in this forum and still no success.

    Any ideas of what i should try Dilettante?

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,244

    Re: Download File from https server using winhttp

    Is there anything here that helps?

    Support for SSL/TLS protocols on Windows

  12. #12
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,244

    Re: Download File from https server using winhttp

    Also see How do I enable TLS 1.2 on Windows 7?

    But I'm not sure this isn't the same as other advice already given above.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width