The TLS 1.2 Setting must come before the HttpWebRequest is created.
This is causing the first connection attempt to fail with a 'could not create secure connection' error.
By moving the TLS 1.2 setting before the web request is create fixes this issue.
The TLS 1.2 Setting must come before the HttpWebRequest is created.
This is causing the first connection attempt to fail with a 'could not create secure connection' error. By moving the TLS 1.2 setting before the web request is create fixes this issue.