「基礎連接已經關閉: 發送時發生錯誤」且僅 https://wx.qq.com 失敗,其他 HTTPS 正常,說明非網絡或代碼邏輯問題,而是協議版本不匹配。
wx.qq.com 強制要求 TLS 1.2。ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
using (var client = new HttpClient()) { var resp = await client.GetAsync("https://wx.qq.com"); }
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP)。SecurityProtocol 而非依賴默認值。