1
votes

I had a problem trying to reach HTTPS web reference service in c# .Net project.

I got this message when i trying to send request to web service.

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

Then i found solution check the answer.

1

1 Answers

1
votes

I put this code to my web service class constructor.

ServicePointManager.ServerCertificateValidationCallback +=
                (mender, certificate, chain, sslPolicyErrors) => true;

It solves the problem.