SecurityProtocolTypeExtensions.Tls12; does not exist in the current context

I am updating security protocols for an existing 3.5.net file to work with paid gateways. I added the following code

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

in my Global.asaxin Application_Start, but it gives me a compile-time error, which

The name "SecurityProtocolTypeExtensions" does not exist in the current context

I followed this link Upport for the TLS System The default versions included in the .NET Framework 3.5.1 for Windows 7 Service Pack 1 and Server 2008 R2 SP1 are provided by Microsoft.

Update 1:

I also tried, as stated in the link above, added both files to the project, now I get the exception " System.NotSupportedException: the requested security protocol is not supported"

Updated 2:

, , . System.NotSupportedException

+4
1

, :

TLS v1.2, ...

- SecurityProtocolTypeExtensions SslProtocolExtensions .

, , TLS 1.2 .NET 3.5.

, , :

System.Net.ServicePointManager.SecurityProtocol = (SecurityProtocolType)0x00000C00;
+5

Source: https://habr.com/ru/post/1668372/


All Articles