Under the Batch Service option, we are running a custom dot net activity, and that .NET tool downloads data from some APIs. It was working fine without any issues until Yesterday(for more than 2/3 years). Now we are facing the below error while downloading data from the APIs. I don't know why we are facing such issue suddenly.
Error: The request was aborted: Could not create SSL/TLS secure channel.
StackTrace: at System.Net.WebClient.OpenRead(Uri address)
at Import.DownloadSite(String url, String type)
The same .NET tool works fine in our local desktop machines(Windows 10 OS). Getting the error only in the batch account machine. So I think the problem is in the batch account machine.
Using the below C# code for downloading data from the APIs:
WebClient wc = new WebClient();
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
return wc.DownloadString(string.Format(ApiUrl, type));
I tried most of the solutions suggested in the below link, and nothting works for me.
https://stackoverflow.com/questions/2859790/the-request-was-aborted-could-not-create-ssl-tls-secure-channel
More information:
.NET Framework: v4.5
Batch machine: Windows Server 2012 R2 (x64)