When Trying to Install Scoop, "Could Not Create SSL/TLS Secure Channel" Error Occurs

Windows
2018-02-26 13:19 (6 years ago) ytyng

When trying to install scoop

An exception occurred while calling "DownloadFile" with "2" arguments: "The request was aborted: Could not create a secure SSL/TLS channel."
Location: Line: 151 Character: 5
+     $wc.downloadFile($url,$to)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : WebException

If this happens.

※ If the scoop installation fails, even if you run the installer again, it will show the message:

Scoop is already installed. Run 'scoop update' to get the latest version.

and the installation will fail.

In that case,

you should download and execute the install.ps1 script from the following link:

https://github.com/lukesampson/scoop/blob/master/bin/install.ps1

However, if you run it as is, the same error message will appear and the process will stop. Therefore, you should comment out the following block in install.ps1:

# prep
if(installed 'scoop') {
write-host "Scoop is already installed. Run 'scoop update' to get the latest version." -f red
# don't abort if invoked with iex——that would close the PS session
if($myinvocation.mycommand.commandtype -eq 'Script') { return } else { exit 1 }
}

Then, when you execute the script, it might stop with the above error:

An exception occurred while calling "DownloadFile" with "2" arguments: "The request was aborted: Could not create a secure SSL/TLS channel."
Location: Line: 151 Character: 5
+     $wc.downloadFile($url,$to)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : WebException

In that case, add the following code to the top of install.ps1:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls11
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

By doing this, you should be able to install scoop using install.ps1.

Current rating: 5

Comments

Archive

2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011