andrewkroh / gvm

Go Version Manager (written in Go for cross-platform usability)
Apache License 2.0
186 stars 24 forks source link

Add command to set the Powershell TLS version before downloading #9

Closed ph closed 6 years ago

ph commented 6 years ago

By default poweshell at least on windows 2012 default to TLS1.0, github requires TLS1.2 so we have to change the value before downloading the executable.

ph commented 6 years ago

@andrewkroh if you remove the line in this PR https://github.com/elastic/beats/pull/7073 you will get the following error:

    win2012: Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure
    win2012: channel.
    win2012: At C:\tmp\vagrant-shell.ps1:7 char:1
    win2012: + Invoke-WebRequest -URI
    win2012: https://github.com/andrewkroh/gvm/releases/download/v0.0. ...
    win2012: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    win2012: ~~~
    win2012:     + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:Htt
    win2012:    pWebRequest) [Invoke-WebRequest], WebException
    win2012:     + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
    win2012:    ll.Commands.InvokeWebRequestCommand
    win2012: C:WindowsSystem32gvm.exe : The term 'C:WindowsSystem32gvm.exe' is not
    win2012: recognized as the name of a cmdlet, function, script file, or operable
    win2012: program. Check the spelling of the name, or if a path was included, verify
    win2012: that the path is correct and try again.
    win2012: At C:\tmp\vagrant-shell.ps1:8 char:1
    win2012: + C:WindowsSystem32gvm.exe --format=powershell 1.10.1 | Invoke-Expression
    win2012: + ~~~~~~~~~~~~~~~~~~~~~~~~
    win2012:     + CategoryInfo          : ObjectNotFound: (C:WindowsSystem32gvm.exe:String
    win2012:    ) [], CommandNotFoundException
    win2012:     + FullyQualifiedErrorId : CommandNotFoundException