Page 1 of 1

Choco install Powershell failure

Posted: Wed Apr 29, 2020 2:07 am
by JvdMaat
When this command runs:
cmd.exe!!! /c "@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object system.net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

I get this back on half my systems:
Exception calling "DownloadString" with "1" argument(s): "The request was aborted: Could not create SSL/TLS secure
channel."
At line:1 char:1
+ iex ((new-object system.net.webclient).DownloadString('https://chocol ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException


Googling the error, they talk about it being a TLS issue where the website doesn't support a lower TLS version. However why does it work on some systems? (Unless chocolatey.com has multiple servers that are configured differently, and it just depends on which IP address they get back?)
Even running the command from ScreenConnect command prompt, I get the same error, so it's consistent.
Is there a PS way to specify TLS 1.2 in this download? (Again, Google says to include this, but not sure on syntax on how/where: [Net.ServicePointManager]::SecurityProtocol = "tls12")

Re: Choco install Powershell failure

Posted: Tue May 05, 2020 1:44 pm
by Cubert
Hmmm...

Not sure, let do a little testing to see if I can force that.