I have a https URL which throws below exception:
Exception Details: System.Exception: The underlying connection was closed: An unexpected error occurred on a send. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.
I tried using the HTTP version of URL and that is working. I also checked if https URLs are accessible from machine and they are accessible without any error, but failing in below code. Also this problem is machine specific.
Line of code throwing error:
using (WebDownloadClient wc = new WebDownloadClient())
{
wc.Headers.Add("Content-Encoding", "gzip");
wc.Headers.Add("Accept-Encoding", "gzip, compress");
wc.DownloadFile(url, fileName);
}