I use the following code to make sure all certificates have passed, even invalid ones, but I would like to know if there is a better way, since this event is called globally, and I want the certificate to pass only for a specific HTTP call and not for others that occur asynchronously.
// This delegate makes sure that non-validating SSL certificates are passed ServicePointManager.ServerCertificateValidationCallback = delegate(object certsender, X509Certificate cert, X509Chain chain, System.Net.Security.SslPolicyErrors error) { return true; };
The above code is just an example of ignoring any non-audit certificate. The problem I am having is that this is a global event. I donβt see at what session the event is taking place. I can have several HTTP requests, and I want to ask the user the action for each request .
source share