Forcing TLS 1.2
Use the following line of code to force usage of TLS 1.2.
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
Note that this is not the recommended way to do this. The recommended method is to use the v4.7 of the .Net Framework.
See: Transport Layer Security (TLS) best practices with the .NET Framework
Versions 4.7 and higher will use the highest version of TLS that is supported by the operating system.
Versions 4.6.x will use the highest protocol available up to TLS 1.2 unless a protocol version is explicitly configured.