Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

How to work with SSL-protected sites

0.00/5 (No votes)
22 Mar 2011 1  
HTTPS
If you deal with SSL-protected sites a couple of methods can be useful:

C#
public void ConfigureSSL()
{
    ServicePointManager.ServerCertificateValidationCallback = CertChecker;
}

private bool CertChecker(object sender, X509Certificate certificate,
                    X509Chain chain, SslPolicyErrors errors)
{
    return certificate.Subject == "Certificate Subject for required site";
}


Call ConfigureSSL() before to request some page.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here