HttpWebRequest 忽略证书
HttpWebRequest 忽略证书(.net 4.0):
System.Net.ServicePointManager.ServerCertificateValidationCallback =
new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult);//验证服务器证书回调自动验证
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(new Uri(Url));
。。。
protected bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{ // 总是接受
return true;
}