how to set ServicePointManager.ServerCertificateValidationCallback in web.config

c#

Solution

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.

Problem

How do I set this in web.config file ``` ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) =>true; ```

Original source