其他分享
首页 > 其他分享> > win10安装Chocolatey报"请求被终止,未能创建SSL/TLS安全通道"

win10安装Chocolatey报"请求被终止,未能创建SSL/TLS安全通道"

作者:互联网

以管理员身份运行

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/instal...'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin

 

报如下错误

另外一台电脑运行同样的指令不报错,也能打开https://chocolatey.org/install.ps1

参考官方给出的troubleshooting ,应该是TLS版本的问题

在Power shell运行下面3条指令

1.

[Enum]::GetNames([Net.SecurityProtocolType]) -contains 'Tls12'

2.If the result is True then your system supports TLS 1.2. You can find out which protocols are being used by running:

[System.Net.ServicePointManager]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12)

3.If the result is True then TLS 1.2 is being used . However, you can add TLS 1.2 explicitly by using:

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

我的情况是步骤2返回false,执行第3条后再运行Chocolatey安装指令问题解决~

标签:TLS,Chocolatey,1.2,ServicePointManager,win10,Net,SecurityProtocol,SecurityProtoc
来源: https://www.cnblogs.com/yuewei-bravo/p/16166752.html