Older methods are now obselete. Use the following...
...
...
System.Net.ServicePointManager.ServerCertificateValidationCallback
+= new System.Net.Security.RemoteCertificateValidationCallback(RemoteCertValidateCallback);
...
and callback method...
public static bool RemoteCertValidateCallback(object sender, X509Certificate cert, X509Chain chain, System.Net.Security.SslPolicyErrors error)
{
return true;
}
or you can simply use (in c# only) anonnymous method,
System.Net.ServicePointManager.ServerCertificateValidationCallback
+= delegate
(
object sender,
X509Certificate cert,
X509Chain chain,
System.Net.Security.SslPolicyErrors error
)
{ return (true); };
0 comments:
Post a Comment