VS2013报错The request was aborted: Could not create SSL/TLS secure channel.

问题描述

Visual Studio 2013 Nuget(扩展和更新)无法连接网络分析和解决方法A connection to the server could not be established because the following error(s) occurred:

The request was aborted: Could not create SSL/TLS secure channel.Please click here to retry the request.

由于出现以下错误,无法建立与服务器的连接:

请求被中止:无法创建SSL/TLS安全通道。

请单击此处重试请求。

报错截图

解决方案

进入Visual Studio 2013 (这里就简称VS2013了)后,从工具-扩展和更新(U)...,进入界面后,点击“联机”面板时,发现无法连接到 Nuget,界面上直接就提示“未能建立到服务器的连接,因为发生了以下错误:请求被终止:未能创建SSL/TLS安全通道。”这个错误,详细信息如图所示:

原因:Nuget官方网站已经不支持http访问, 只支持https,但是VS2013访问https默认使用的协议为Tls1.1,但是Nuget官方网站只支持Tls1.2,这是两边不匹配导致的问题。

第一步:

复制命令

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

解决:要解决这个问题,那就要使VS2013以Tls1.3访问Nuget的官网,具体解决办法为在程序包管理控制台运行如上命令

第二步:

具体步骤如下:工具 -- 库程序包管理器(N) -- 程序包管理器控制台(o) -- 底部弹出控制台输入界面。

输入上文中解决的命令(即[Net.ServicePointManager]::SecurityProtocol=[Net.ServicePointManager]::SecurityProtocol-bOR [Net.SecurityProtocolType]::Tls12),按回车键,即可;

再次查看扩展和更新,发现能正常联网了,能正常访问Nuget官方网站了,默认的就可以查看到很多可以下载使用的插件。

成功解决

参考文献

Visual Studio 2013 Nuget(扩展和更新)无法连接网络分析和解决方法

猜你喜欢

转载自blog.csdn.net/Yangy_Jiaojiao/article/details/128682340