The underlying connection was closed: An unexpected error occurred on a send.
At the beginning of the application, add this code:
Constant 768 means TLS 1.1 security protocol and constant value 3072 means TLS 1.2.
ServicePointManager.SecurityProtocol = (SecurityProtocolType)768 | (SecurityProtocolType)3072;