hasanaydogar
hasanaydogar

Reputation: 905

How to make HTTPS SOAP request bypassing SSL certificate in .Net C#?

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

Answers (1)

hasanaydogar
hasanaydogar

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

Related Questions