C# System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send
Setting the HttpWebRequest.KeepAlive to false didn’t work for me. Since I was accessing a HTTPS page I had to set the Service Point Security Protocol to Tls12. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; Notice that there are other SecurityProtocolTypes: SecurityProtocolType.Ssl3 SecurityProtocolType.Tls SecurityProtocolType.Tls11 So if the Tls12 doesn’t work for you, try the three remaining options. Also notice you … Read more