michaelp0730
9/28/2017 - 8:41 PM

HTTP Functional Tests - Server Certificate Validation Callback

Used to override cert errors when running functional tests locally. Either option works on it's own, but both are included for convenience.

public SomeClassName() // Class Constructor
{
    ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
}

[TestInitialize]
public void Setup()
{
    ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback( delegate
    { 
        return true; 
    });
}