C# 解决网站安全凭证问题
方法一:添加安全凭证
方法二: 添加安全性凭证代码
添加.net安全程序集
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
添加远程安全返回事件
private bool CheckValidationResult(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
}
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
此方法必须在创建Url之前
原文链接:https://www.cnblogs.com/tx720/p/4999748.html
原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/18287