WCF Client in .NET 4.5.1: How to enable TLS 1.2 when WebRequest is used?

While not easy to figure out, the needed property is:


This can be used to disable and enable TLS levels in the WCF environment.

Further, you can see what WCF is currently set to using:


With thanks to: How do I disable SSL fallback and use only TLS for outbound connections in .NET? (Poodle mitigation)

You should work with .NET 4.5 or above version and add this line in your code:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;