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