I am updating Security protocols to my existing 3.5 .net framework application to work my payment gateways smooth. I have added following code
System.Net
The fix is stated in the article you linked to:
To include the support for TLS v1.2, include the source files in your project...
In other words - you need to add the SecurityProtocolTypeExtensions
and SslProtocolExtensions
types from the article to your own project.
It's a bit of an ugly hack, but is required because TLS 1.2 was released after .NET 3.5.
Alternatively if you want to avoid using these extensions and don't mind unlabelled magic numbers in your code, you could ignore the code in the article and just set this instead:
System.Net.ServicePointManager.SecurityProtocol = (SecurityProtocolType)0x00000C00;