Reputation: 905
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.
Upvotes: 2
Views: 3275
Reputation: 905
I put this code to my web service class constructor.
ServicePointManager.ServerCertificateValidationCallback +=
(mender, certificate, chain, sslPolicyErrors) => true;
It solves the problem.
Upvotes: 2