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

运行invoke-webrequest报错:web

  

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

您能够方便地查明它:网站

  

[Net.ServicePointManager]::SecurityProtocol

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

咱们只须要这样操做就能够启用更多的服务:code

  

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

至此问题已经彻底解决blog

  

相关文章
相关标签/搜索