Thursday, 9 February 2012

Important Exception and Solutions found on Web & SharePoint Development

1. 
Exception: 
"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel" on Service call
Solution: 
- Add the folowing entry in web.config
<servicePointManager checkCertificateName="false" checkCertificateRevocationList="false"/>
- Write the following code just before the service call
ServicePointManager.ServerCertificateValidationCallback = (obj,certificate,chain,errors) => true;