Thursday, 7 April 2011

Could not establish trust relationship for the SSL/TLS secure channel with authority

I recently had this error (Could not establish trust relationship for the SSL/TLS secure channel with authority) when trying to make a remote call from a C# web app. I hunted around and came across this article on thejoyofcode.com.

ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(
    delegate
    {
        return true;
    }
);

So I used the suggested code to bypass the certificate verification, but got a trust level permission error. In order to get round that I modified the Web.Config file to have the trust level set to Full.

Just for the record, this is a quick and dirty hack while I sort out what the actual problem is ;)

No comments:

Post a Comment