ServerCertificateValidation.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
using System.Net.Security;
using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; namespace Elastic { /// <summary> /// Handlers for certificate validation /// </summary> public class ServerCertificateValidation { /// <summary> /// Skip certificate validation /// </summary> public static RemoteCertificateValidationCallback AllowAll() { return new RemoteCertificateValidationCallback(delegate (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors policyErrors) { return true; }); } } } |