I\'m trying to bypass https certificate validation only to our own testing environment (multiple machines), while trying to keep certificate validation for all the other connect
I used a flag in the Web.config file to indicate when a certificate is self-signed and we also know that we are in a development environment:
In the code we must check this flag to apply the certificate validation exception:
using System.Net;
bool isSelfSignedCertificate = Convert.ToBoolean(ConfigurationManager.AppSettings["isSelfSignedCertificate"]);
if (isSelfSignedCertificate)
{
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
}