這是跟SSL有關的問題
先寫一個Class
internal class AcceptAllCertificatePolicy : ICertificatePolicy
{
public AcceptAllCertificatePolicy()
{
}
public bool CheckValidationResult(ServicePoint sPoint, System.Security.Cryptography.X509Certificates.X509Certificate cert,
WebRequest wRequest, int certProb)
{
// Always accept
return true;
}
}
然後再發送Request之前寫下面這行
System.Net.ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
全站熱搜
留言列表