I\'ve downloaded some sample code that is a bit outdated. It has the following class:
public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
Include the following class in your code
public static class SSLValidator
{
private static bool OnValidateCertificate(object sender, X509Certificate certificate, X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
return true;
}
public static void OverrideValidation()
{
ServicePointManager.ServerCertificateValidationCallback =
OnValidateCertificate;
ServicePointManager.Expect100Continue = true;
}
}
Then call the following before you make service call but be careful to remove this code on the production when you have real certs
SSLValidator.OverrideValidation();
Or you can do the following to use it only for debugging
#if DEBUG
SSLValidator.OverrideValidation();
#endif