Unable to download files into Appveyor VM for installation

I'm trying to download and install OpenSSL since my application needs to link against it.

I have tried both of the following commands, as suggested on this page:

- ps: (new-object net.webclient).DownloadFile('https://www.openssl.org/source/openssl-1.0.2d.tar.gz', 'openssl-1.0.2d.tar.gz')
- ps: Start-FileDownload 'https://www.openssl.org/source/openssl-1.0.2d.tar.gz'

However both fail in the same way:

Start-FileDownload 'https://www.openssl.org/source/openssl-1.0.2d.tar.gz'
Exception calling "DownloadFile" with "3" argument(s): "The underlying connection was closed: An unexpected error occurred on a send."
At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-api.psm1:238 char:5
+     [Appveyor.BuildAgent.Api.RestBuildServices]::DownloadFile($Url, $FileName, $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

This looks vaguely like it might be a firewall issue. Is it possible that AppVeyor blocks outbound SSL requests on port 443?

Thanks in advance for your help!

  1. This works:

    [Net.ServicePointManager]::SecurityProtocol = 'Tls12'
    (new-object net.webclient).DownloadFile('https://www.openssl.org/source/openssl-1.0.2d.tar.gz', "$env:appveyor_build_folder\openssl-1.0.2d.tar.gz")
    
  2. Thanks Feodor! Unfortunately my first attempt to do this in appveyor.yml failed:

    - ps: [Net.ServicePointManager]::SecurityProtocol = 'Tls12'
    - ps: Start-FileDownload 'https://www.openssl.org/source/openssl-1.0.2d.tar.gz'
    

    Results in this exception:

    Error parsing appveyor.yml: (Line: 30, Col: 34, Idx: 450) - (Line: 30, Col: 62, Idx: 478): While parsing a block mapping, did not find expected key.
    

    I'm guessing that the appveyor.yml parser doesn't like the PowerShell square brackets syntax. Any ideas? Is there some way to escape it?

  3. Double-quoting the command seems to have worked, thank you!

    - ps: "[Net.ServicePointManager]::SecurityProtocol = 'Tls12'"
    - ps: Start-FileDownload 'https://www.openssl.org/source/openssl-1.0.2d.tar.gz'
    
  4. chris+appveyor closed this discussion on 22 Dec, 2015 09:38 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions