1.在http辅助类中添加方法如下:
private static bool RemoteCertificateValidate(object sender, X509Certificate cert,X509Chain chain, SslPolicyErrors error)
{
// trust any certificate!!!
System.Console.WriteLine("Warning, trust any certificate");
//为了通过证书验证,总是返回true
return true;
}
2.在http辅助类的构造方法添加如下代码:
ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidate;//验证服务器证书回调自动验证
参考:http://wangzhiyu811.blog.163.com/blog/static/127254044201222462536173/
神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试