2

I am currently developing a .NET client (with WCF) that must consume a third-party SOAP endpoint. This third-party endpoint requires HTTPS. When I test the endpoint with SoapUI, the endpoint responds correctly. However, when I try to consume the endpoint with the .NET client, I get the following exception:

System.ServiceModel.CommunicationException: An error occurred while making the HTTP request This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.

The inner exception was:

Unable to read data from the transport connection : An existing connection was forcibly closed by the remote host

The only solution I found was to use a newer version of TLS but this did not solve the issue.

Alejandro
  • 351
  • 4
  • 11
  • What did you do to "use a newer version of TLS" ? – Crowcoder Dec 19 '17 at 15:40
  • I tried calling the web service using .NET 4.6. – Alejandro Dec 19 '17 at 18:40
  • 1
    Run this code sometime before you make the call: `ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;` – Crowcoder Dec 19 '17 at 18:41
  • I could get it working by using the .NET 2.0 API instead of WCF. If anyone has a clue why it works with the old API and not with WCF, please answer. – Alejandro Dec 20 '17 at 13:57
  • Possible duplicate of [WCF Error "This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case"](https://stackoverflow.com/questions/2013880/wcf-error-this-could-be-due-to-the-fact-that-the-server-certificate-is-not-conf) – kenorb Oct 02 '18 at 16:31

0 Answers0