2

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.

hasanaydogar
  • 885
  • 11
  • 24

1 Answers1

2

I put this code to my web service class constructor.

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

It solves the problem.

hasanaydogar
  • 885
  • 11
  • 24