As the site I was connecting to was a test site from a 3rd party known to me, but not set up correctly at their end, to bypass this check I added the following line before calling GetRequestStream on my HttpWebRequest.
ServicePointManager.ServerCertificateValidationCallback
+= new
System.Net.Security.RemoteCertificateValidationCallback
(CustomValidation);
and added the CustomValidation function as follows:
private static bool CustomValidation(object sender,
X509Certificate cert, X509Chain chain,
System.Net.Security.SslPolicyErrors error)
{
return true;
}
2 comments:
Easiest solution I found to this problem off google. Thanks mate!
Good one keep it up :)
Post a Comment