您正在按照正确的方式进行 *** 作,但是用户可能会向安装了无效SSL证书的站点提供URL。如果在发出实际的Web请求之前放入以下行,则可以忽略这些证书问题:
ServicePointManager.ServerCertificatevalidationCallback = new System.Net.Security.RemoteCertificatevalidationCallback(AcceptAllCertifications);
在哪里
AcceptAllCertifications定义为
public bool AcceptAllCertifications(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certification, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors){ return true;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)