Wednesday, March 16, 2011

The request failed. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

I tried to retrive data from Exchange Server 2010 using Exchange API 1.0 but below error fire

Error:
The request failed. The underlying connection was closed: Could not establish trust relationship  for the SSL/TLS secure channel.

Solution:
Add below code before access web service
ServicePointManager.ServerCertificateValidationCallback += delegate(object sender,
                X509Certificate certificate,
                X509Chain chain,
                SslPolicyErrors sslPolicyErrors)
            {
                return true;
            };
This Error occur when you access Secure Web Service.

Happy Coding !!!

1 comment:

  1. My partner and i still cannot quite believe that I could become one of those studying the important points found on your site. My family and I are really thankful on your generosity and for providing me opportunity pursue the chosen career path. Thanks บาคาร่าออนไลน์ for the important information I managed to get from your website.

    ReplyDelete