HttpWebRequest 请求被中止: 未能创建 SSL/TLS 安全通道

在HttpWebRequest前设置代码

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
posted on 2022-10-17 12:29  wakaka_wka  阅读(244)  评论(0编辑  收藏  举报