luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
245 stars 58 forks source link

get-lit.ps1 failing happening again #244

Closed Lautenschlager-id closed 5 years ago

Lautenschlager-id commented 5 years ago

I've received lots of reports, Sinister had the same problem before (https://github.com/luvit/lit/issues/234) It mentions it's not possible to convert "Tls12" for the type "System.Net.SecurityProtocolType". Line 1, char 20. (No screenshots because it's in portuguese :P )

squeek502 commented 5 years ago

Can't reproduce on my machine (Windows 7). What OS are you running, and what command are you executing?

Lautenschlager-id commented 5 years ago

Four people and I tried, and both of them were using Windows 7 (x86 and x64). We all could reproduce it.

Using the command in the luvit website

PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = 'Tls12'; iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/master/get-lit.ps1'))"

image

Second error is due to "exception calling DownloadString with 1 argument, the connection was closed, unexpected error"

squeek502 commented 5 years ago

Let me know if this works for you:

PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/master/get-lit.ps1'))"

If not, try this as well:

PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12; iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/master/get-lit.ps1'))"

EDIT: Also, just for more information, run this and let me know what version of Powershell you're running:

powershell -command "(Get-Variable PSVersionTable -ValueOnly).PSVersion" 
Lautenschlager-id commented 5 years ago

First one does not. Sent 2 erros: Cannot convert null to System.Net.SecurityProtocolType due to wrong enumeration values and exception calling DownloadString with 1 argument, the connection was closed, unexpected error

Second one does not, too. Sent 1 error: exception calling DownloadString with 1 argument, the connection was closed, unexpected error

For the last command,

Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1
squeek502 commented 5 years ago

Powershell 2.0 is pretty old and as far as I can tell it uses .NET Framework 3.5 which does not support the required TLS 1.2.

Try upgrading to at least Powershell 3.0: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell

Lautenschlager-id commented 5 years ago

Oh! That worked indeed. Thank you

Could you, or whoever manages luvit.io, meniton that ps3.0+ is needed? That would save so much time haha.

Thank you!