How do I set this in web.config file
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) =>true;
ServicePointManager. ServerCertificateValidationCallback is a function, that is used to validate a server certificate. Our application uses custom validation by the client.
An application can set the ServerCertificateValidationCallback property to a method to use for custom validation by the client of the server certificate.
Try this;
Write your code in Application_Start of Global.asax.
It should work..!!!
OR
In Config file;
<configuration>
<system.net>
<settings>
<servicePointManager
checkCertificateName="false"
checkCertificateRevocationList="false"
/>
</settings>
</system.net>
</configuration>
you can also VISIT MSDN for the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With