//添加https兼容处理

//添加https兼容处理
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback((obj, certificate, chain, sslPolicyErrors) =>
{
return true;
});
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
ServicePointManager.ServerCertificateValidationCallback += (senders, certificate, chain, sslPolicyErrors) => true;

posted @ 2024-10-23 15:53  Godlovezk  阅读(1)  评论(0编辑  收藏  举报