记录一下postman 正常返回 c# 模拟https 请求出现The request was aborted: Could not create SSL/TLS secure channel.
电脑版发表于:2023/7/24 14:02
在发送请求前加入如下代码:
//始终验证服务器证书
ServicePointManager.ServerCertificateValidationCallback =
(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => { return true;};
//设置协议
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 |
SecurityProtocolType.Tls12 |
SecurityProtocolType.Tls11 |
SecurityProtocolType.Tls;