C#.Net中WebRequest对象对Https(SLL协议)网站的访问

与访问HTTP网站不同的是需要加 

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);

 

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

你可能感兴趣的:(request)