title: How to validate a SSL certificate with C#
body: <p>maybe one of you can help me answer my question about validating certificates in the .NET framework. Unfortunately I found only superficial answers to my questions during my research on the Internet, but no exact explanation.</p>
  
  <p>Meanwhile I know that I can check in my software with the following code whether a certificate is valid.</p>
  
  <pre><code>ServicePointManager.ServerCertificateValidationCallback += ValidateRemoteCertificate;
  
  private bool ValidateRemoteCertificate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors policyErrors)
  {
     return policyErrors == SslPolicyErrors.None;
  }
  </code></pre>
  
  <p>But I would now like to know what Microsoft is checking here exactly? What checks were performed by the framework to make the result SslPolicyErrors.None?</p>
  
  <p>For example, is the root certificate also validated here and where it comes from? If so, how? </p>
  
  <p>In your opinion is it still necessary (or useful) to add additionally my own checks to these checks, which the .NET Framework hasn't made yet?</p>