How to suppress certificate verification errors

When I was implementing WebDav web-service bridge between custom corporate system and MS Exchange Server 2007 I have got a very annoying issue with ssl certificate checks, you know, it is when your favourite browser shows message: “Add security exception or leave this place” (something like this). Of course it is necessary for browser and for surfing Internet, but sometimes we simply do not need such checks or messages or whatever related info, to disable such warnings you can put a very simple snippet of code into your static constructor (C#):

ServicePointManager.ServerCertificateValidationCallback +=
delegate
{
// Disables SSL policy errors handling.
return true;
};

Also, you can implement your own errors handling using this approach.

Happy coding! (:

Best regards,
Yahor