一佳一

记录像1+1一样简洁的代码

导航

请求对象前加入 

 ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;

然后实现该方法

private static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
  return true;
}

 

就可以了