Asp.Net 3.5 with TLS1.2 issue with SecurityProtocol

-1

started working on making sure a website work on Tls1.2, Asp.net website:3.5 frame work. found related answer- that we need to install the msupdate and need to change the os registry in order to change at os level, But to change at code level from 3.5 found work around, as suggested in the work around, added the code 1.ADDED TWO CLASSES IN THE CODE

SslProtocolsExtensions.cs

namespace System.Security.Authentication
{
    public static class SslProtocolsExtensions
    {
        public const SslProtocols Tls12 = (SslProtocols)0x00000C00;
        public const SslProtocols Tls11 = (SslProtocols)0x00000300;
    }
}

SecurityProtocolTypeExtensions.cs

namespace System.Net
{
    using System.Security.Authentication;
    public static class SecurityProtocolTypeExtensions
    {
        public const SecurityProtocolType Tls12 = (SecurityProtocolType)SslProtocolsExtensions.Tls12;
        public const SecurityProtocolType Tls11 = (SecurityProtocolType)SslProtocolsExtensions.Tls11;
        public const SecurityProtocolType SystemDefault = (SecurityProtocolType)0;
    }
}

AND ADDED THE Below code in the aspx page, which gives the following error. Servicepointmanager.securityprotocol does not exist in the current context ..have'nt found any direct answer, if have answer please share appreciated

 public const SslProtocols _Tls12 = (SslProtocols)0x00000C00;
        public const SecurityProtocolType Tls12 = (SecurityProtocolType)(0x300 | 0xc00);
        ServicePointManager.SecurityProtocol = (SecurityProtocolType)0x00000C00;
c#
asp.net
asked on Stack Overflow Feb 14, 2019 by Mahesh Kumar • edited Feb 19, 2019 by Mahesh Kumar

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0