FluffyBike
FluffyBike

Reputation: 2322

Does ServicePointManager.ServerCertificateValidationCallback overwrite existing certificate validation in .Net?

I'm implementing a WCF client that will use certificates for secure communication. The server will also present a certificate and I would like to implement the ServicePointManager.ServerCertificateValidationCallback simply to log the certificate from the server. Here's an example:

using System.Net;

ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidate;

private bool RemoteCertificateValidate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
{
    // certificate logging goes here
}

My question is this, will the default certificate validation that is done by the .Net framwork still happen? Or will my implementation of the ServerCertificateValidationCallback overwrite the .Net certificate validation?

Upvotes: 0

Views: 185

Answers (1)

Jiayao
Jiayao

Reputation: 568

As I know the default certificate validation is done prior to the ServerCertificateValidationCallback.

You can follow this link for more information.

Upvotes: 1

Related Questions