ServicePointManager.ServerCertificateValidationCallback
is a global static property that can be overwritten by any bit of code in your application simply by doing:
ServicePointManager.ServerCertificateValidationCallback
= (sender, cert, chain, sslPolicyErrors) => true;
Why did they decide to implement it that way? Surely it should be a property on the WebRequest
object, and you should have a very good reason for why you are ignoring the certificate.