title: System.Net.CertificatePolicy to ServerCertificateValidationCallback Accept all certificate policies
body: <p>I've downloaded some sample code that is a bit outdated. It has the following class:</p>
  
  <pre><code>public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
  {
      public TrustAllCertificatePolicy()
      { }
  
      public bool CheckValidationResult(ServicePoint sp,
                System.Security.Cryptography.X509Certificates.X509Certificate cert,
                WebRequest req, 
                int problem)
      {
          return true;
      }
  }
  </code></pre>
  
  <p>later on in the code it calls the following:</p>
  
  <pre><code>System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
  </code></pre>
  
  <p>It gives the following warning:</p>
  
  <blockquote>
    <p>Warning   1   'System.Net.ServicePointManager.CertificatePolicy' is obsolete: 'CertificatePolicy is obsoleted for this type, please use ServerCertificateValidationCallback instead. <a href="http://go.microsoft.com/fwlink/?linkid=14202">http://go.microsoft.com/fwlink/?linkid=14202</a>'</p>
  </blockquote>
  
  <p>What is the current procedure to achieve the equivalent functionality?</p>
  
  <p>I've read an <a href="http://social.msdn.microsoft.com/Forums/vstudio/en-US/c98ea134-c582-4c2a-8c42-d7e31f7fe389/certificatepolicy-vs-servercertificatevalidationcallback">article</a> on MSDN but I'm unsure of how to convert? This is for a class library. I appologize if it seems as though I havn't researched this enough but when it comes to ssl certificates, it's a bit out of my realm. Any help is greatly appreciated!</p>