Overriding errors for trust relationship failures by trusting all certificates
While developing an application, I needed to browse to a url to read a file. Accessing the server url threw a error. So I added a method to trust all certificates from the url before I called the url.. That resolved the issue I was facing.
Code Snippet
Added this code before calling the server url :// Trust all certificates
System.Net.ServicePointManager.ServerCertificateValidationCallback =
((sender, certificate, chain, sslPolicyErrors) => true);
No comments:
Post a Comment