qr

fistfulofbytes

How to bypass SSL validation for Exchange Webservices Managed API


PDF

Turns out that at my first day at work I had to wrestle with this stuff.. because I was looking for exchange specific solution I failed… if it had occur to me to look for a WCF specific thing it would have saved me a ton of time…

anyways here is what you need to do in your code declare these

using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public static bool OnValidationCallback(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors errors)
{
 return true;
}

put this before your code executes

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(OnValidationCallback);

and you are good to go..