Created
October 25, 2018 11:56
-
-
Save brandedoutcast/1c99eaeaeec156cc5db9cb9955e7fd93 to your computer and use it in GitHub Desktop.
Ignore SSL certificate check in a WCF service for .NET Framework & dotnet core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For dotnet core | |
// Put this inside the Proxy client constructor | |
this.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = new System.ServiceModel.Security.X509ServiceCertificateAuthentication() | |
{ | |
CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None, | |
RevocationMode = System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck | |
}; | |
// For .NET Framework | |
// Place this anywhere in the program so that it's run before initializing the Proxy client | |
System.Net.ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, errors) => true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment