I created an application that periodically(every 1st Sunday of the month) send request to data.cms.gov to check for pecos registered physician. The code went well, however it stopped working a few days ago. I'm getting this response "Unable to read data from transport connection. An existing connection was forcibly closed by the remote host." Who encounter this before or can somebody help with this? I use the code below for my request
string end_point = "https://data.cms.gov/resource/qcn7-gc3g.json?$$app_token=myapp_token&npi=";
string cms_uri = end_point + npi;
System.Net.WebClient cms_wc = new System.Net.WebClient();
byte[] bResponse = cms_wc.DownloadData(cms_uri);
string cms_response = System.Text.Encoding.ASCII.GetString(bResponse);
As a security upgrade, we've disabled TLS 1.0 as an allowable SSL protocol. My guess is that that's what's triggering your disconnect.
https://support.socrata.com/hc/en-us/articles/235267087
You'll need to instruct .NET to to use TLS 1.1 or 1.2. You should be able to do that by adding the following before you create your client:
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
There's some more info in this issue on one of the C# .NET libraries for the SODA API.