![](/img/trans.png)
[英]Server Error: The request was aborted: Could not create SSL/TLS secure channel
[英]SChannel error: The request was aborted: Could not create SSL/TLS secure channel
我正在嘗試在以下站點訪問和使用 XML: https://www.dhs.gov/ntas/1.1/alerts.Z0F635D0E0F3874FFF8B581C132E6C7A7 . 但是,我不斷收到消息:“請求已中止:無法創建 SSL/TLS 安全通道。” 當我在我們的開發服務器上運行我的應用程序時。 我在我們服務器的事件日志中看不到任何內容。
奇怪的是,當我從本地主機訪問提要時,它工作正常。
我的應用程序使用的是 .Net 框架 4.6.2。 據我了解,它應該默認支持 TLS12(除非我錯了)。 當直接瀏覽鏈接時,我嘗試的瀏覽器——Chrome、Firefox、Edge——可以成功訪問並顯示XML。 IE11 是例外,無法顯示。
我嘗試通過以下方式手動添加 TLS12 支持:
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | 安全協議類型.Tls11 | 安全協議類型.Tls12
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072 | (SecurityProtocolType)768 | 安全協議類型.Tls;
這是我正在使用的代碼。 如上所述,這適用於本地主機。
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(NTASUri);
request.UserAgent = Request.ServerVariables["HTTP_USER_AGENT"];
WebResponse response = request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(responseFromServer);
return xmlDoc.InnerXml;
有沒有人有任何想法可以做些什么來讓它工作?
謝天謝地,我的系統人員最終解決了這個問題。 我們現在可以在我們的服務器上使用 feed。
在注冊表中,HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Cryptography\Configuration\Local\SSL\00010002\ 密鑰下列出的密碼套件是有限的,只有 Windows 支持的密碼套件的子集。
刪除指定一組密碼套件的函數字符串值會將 Windows 客戶端返回到默認行為/順序。
更多信息:
https://www.windows-security.org/2c488aac52906551ff218fd5c2bdaddc/ssl-cipher-suite-order
希望這可以幫助其他人在這種情況下。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.