shikha goyal
shikha goyal

Reputation: 51

how to set ServicePointManager.ServerCertificateValidationCallback in web.config

How do I set this in web.config file

ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) =>true;

Upvotes: 5

Views: 11060

Answers (1)

H. Mahida
H. Mahida

Reputation: 2366

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.

Upvotes: 5

Related Questions