
Currently I use the callback with a extra check on the names:
First I add the server certificate validation callback, the standard code that is provided by MS is good until you start using Fiddler
Code: Select all
If ServicePointManager.ServerCertificateValidationCallback Is Nothing Then ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateRemoteCertificate)
Code: Select all
'-trusted domain/issuer
If (certificate.Subject.IndexOf(trustedDomain_cdpc) = -1 Or certificate.Issuer.IndexOf(trustedIssuer_cdpc) = -1) Then
Return False
End If