From d0cc73eff6e2ce780dddd01ddbaac1a081abafbd Mon Sep 17 00:00:00 2001 From: Mark Tiedemann Date: Tue, 9 Jul 2019 18:28:59 +0200 Subject: [PATCH] Force TLS v1.1 when accessing github (#71) --- README.md | 24 ------------------------ install.ps1 | 3 +++ 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index a819edf..45bd3ee 100644 --- a/README.md +++ b/README.md @@ -55,30 +55,6 @@ brew install deno ## Known Issues -### Could not create SSL/TLS secure channel - -``` -PS C:\> iwr https://deno.land/x/install/install.ps1 -useb | iex -iwr : The request was aborted: Could not create SSL/TLS secure channel. -At line:1 char:1 -+ iwr https://deno.land/x/install/install.ps1 -useb | iex -+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException - + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand -``` - -**When does this issue occur?** - -If your systems' [ServicePointManager](https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager.securityprotocol) is configured to use an out-dated security protocol, such as, TLS 1.0. - -**How can this issue be fixed?** - -Configure your system to use an up-to-date security protocol, such as, TLS 1.2: - -```powershell -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -``` - ### Running scripts is disabled ``` diff --git a/install.ps1 b/install.ps1 index 8618e0e..4c50d89 100644 --- a/install.ps1 +++ b/install.ps1 @@ -47,6 +47,9 @@ $OS = if ($IsWindows) { } } +# GitHub requires TLS 1.2 +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + $DenoUri = if (!$Version) { $Response = Invoke-WebRequest 'https://github.com/denoland/deno/releases' -UseBasicParsing if ($PSVersionTable.PSEdition -eq 'Core') {