Invoke-WebRequest : 请求被中止: 未能创建 SSL/TLS 安全通道。


运行invoke-webrequest报错:

  

  根据你的 PowerShell、.NET Framework 的版本和升级,WEB 连接的缺省安全协议可能仍然是 SSL3。

您可以方便地查明它:

  

[Net.ServicePointManager]::SecurityProtocol

  返回的协议不包含 Tls12,那么可能无法用 PowerShell 连接到安全的 Web Service 和网站。

我们只需要这样操作就可以启用更多的服务:

  

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

至此问题已经完全解决

  

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM