Wednesday, June 8, 2011

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.System.Web.Services in sharepoint 2010

Hi Guys,

Today I am connect to SharePoint web service from external machine but I am getting error "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.System.Web.Services ".

I searched on Google and found below solution.

//Trust all certificates
System.Net.ServicePointManager.ServerCertificateValidationCallback =
((sender, certificate, chain, sslPolicyErrors) => true);