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安装指令问题解决~

posted @   寒冬将至  阅读(323)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
点击右上角即可分享
微信分享提示