1

I'm having a problem using a WCF call from a Web application to my WCF service running on same server. This call works fine for some time, but then stopped working all of a sudden, and has not worked since.

I have web application hosted at https://www.example.com/CallWebService/Default.aspx

above url is making call to WCF service at https://www.example.com/sampleservice/service.asmx.

both are hosted on same server different directory.

It was working correctly, without any change in application code,and without any server side change, suddenly it is giving error message :

"An error occurred while making the HTTP request to https://www.example.com/sampleservice/service.asmx. 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."

Tried with traceviewer showing following error :

"System.ServiceModel.CommunicationException: An error occurred while making the HTTP request to https://www.example.com/sampleservice/service.asmx. 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. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host"

Can any one suggest anything on this ?,i have been stuck into this since 3 days.... found no working solution

Ankit
  • 760
  • 6
  • 15
user3782114
  • 542
  • 2
  • 7
  • 22
  • 1
    Looks like you use SSL. Make sure your certificate hasn't expired – Kevin Gosse Mar 29 '17 at 06:47
  • @KevinGosse ssl expiring on 31/03/2019, actually My certificate was expiring on 23-03-2017, so i renew my ssl and re install it on 18-03-2017 – user3782114 Mar 29 '17 at 06:49
  • You might be hitting an exception which is not handled in your code. Try logging. – Karthik AMR Mar 29 '17 at 06:55
  • i tried with traceviewer, exception written above... – user3782114 Mar 29 '17 at 06:58
  • Add logging in your code and you'll come to know the actual stacktrace of the exception in your code – Karthik AMR Mar 29 '17 at 07:05
  • @KarthikAMR can you give me reference about how to do it ? – user3782114 Mar 29 '17 at 07:10
  • For simplicity, add a static class named logger and have a property of a file class. Write the exceptions in a file using the Logger class. Or you can create a new files and write exception every time when you hit an error in the catch block. – Karthik AMR Mar 29 '17 at 07:15
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/139328/discussion-between-user3782114-and-karthik-amr). – user3782114 Mar 29 '17 at 07:21
  • I noticed that it has been stopped working since i install new ssl certificate, but i also try reinstalling old ssl again as there were still few day left before expiry but issue do not resolved. – user3782114 Mar 29 '17 at 07:35
  • I checked Test SSL Protocol Support on https://foundeo.com for may domain it shows that SSLv2 and SSLv3 is disabled, and in my Default.aspx.cs there is line System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Ssl3; could it be causing the issue ? – user3782114 Mar 29 '17 at 10:36
  • 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:32

1 Answers1

0

We had same issue it was related to network, check your load balancer and see if there is any error, usually network issue if it happens suddenly.

  • this should be a comment – zedling Dec 10 '21 at 12:22
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 10 '21 at 12:22