You are setting ServicePointManager.SecurityProtocol twice, try removing the line:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
You can also try setting this first:
ServicePointManager.Expect100Continue = true;
Otherwise try the steps here:
cannot-connect-to-a-server-by-using-the-servicepointmanager-or-sslstre[
^]
Btw. using the
ServicePointManager Class[
^] is not recommended anymore:
Quote:
We don't recommend that you use the ServicePointManager class for new development. Instead, use the System.Net.Http.HttpClient class.