I'm making HttpRequests to an external server from my ASP.NET application, to a URL like e.g.:
https://1.2.3.4:12345/Data/Users?Id=1
The server is running a service that responds to these requests with xml (like a web service). My code makes a GET request like this:
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 fine on my Development machine.
But on my Test machine (old windows server 2003 64 box) it fails with this exception:
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
Googling tells me this is error has about a million different possible causes. None seem to apply.
Details:
Can anyone suggest something to try? A possible cause? A way to narrow it down a bit?
I finally found a relevant error in the server's windows event log:
An 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. The SSL connection request has failed.
I created a new question, an actually answerable one, Here: How to add to the cipher suites available to ASP.NET HttpRequest client?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With