The Http request does not execute from ASP.NET code on the test server (IE also fails ... but not firefox !?)

I do HttpRequests for an external server from my ASP.NET application, to a URL, for example, for example:

https://1.2.3.4:12345/Data/Users?Id=1 

The server runs a service that responds to these requests using xml (for example, web services). My code makes a GET request as follows:

 var wc = new System.Net.WebClient(); wc.Credentials = credentials; // username and password for service // get data from server. string s = Encoding.ASCII.GetString(wc.DownloadData(url)); return s; 

It works great on my development machine.

But on my test computer (old Windows Server 2003 64 server) it is with this exception:

System.Net.WebException: The underlying connection was closed: An unexpected error occurred while sending.
---> System.IO.IOException: cannot read data from transport connection: existing connection was forcibly closed by the remote host.
---> System.Net.Sockets.SocketException: existing connection was forcibly closed by the remote host

Googling tells me that this error has about a million different possible causes. It seems not.

More details:

  • I can make a request by pasting the URL into the browser and it works on the Dev server, but on the test server it works in Firefox, but not IE (!?!) IE gives the general "Internet Explorer cannot display the web page" looks exactly the same if I change the IP address to something that does not exist.
  • The server is protected by a self-signed SSL certificate, which was added to the local computer trusted certificate store on both clients (test and dev boxes). But this is unlikely a problem with the certificate , since it works fine on dev, and it still happens if you ignore certificate verification (when testing).
  • I can install telnet on the server (with the correct IP and port) from the test window.

Can anyone suggest trying something? Possible reason? A way to narrow it down a bit?

+7
source share
1 answer

Finally, I found a corresponding error in the Windows server event log:

A TLS 1.0 connection request was received from a remote client application, but none of the cipher suites supported by the client application are supported by the server. Failed to complete SSL connection request.

I created a new question, actually responsible, here: How to add to the cipher suites available to the HttpRequest ASP.NET client?

+2
source

All Articles