Search code examples
c#tls1.2sslstream

Enable Windows 2008 R2 to accept cast on enum SslProtocols 3072


Enable cast (System.Security.Authentication.SslProtocols)3072) on window server 2008 r2 without patch

I have a function written in c# framework 2.0 that performs authentication by setting the tls 1.2 protocol using an enum, on windows 10 and windows server 2012 works while on windows server 2008 R2 only works if updated with the latest patches. I need not to perform the updates, is there any registry key to enable the enum on the c# code that I report below?

the 2.0 and 4.5 .Net framework are installed on the server

SslStream sslStream;

sslStream = new SslStream(clientSocket.GetStream(), false, certificateValidator);

// Authenticate the server
try
{
    sslStream.AuthenticateAsClient(hostname,null,((System.Security.Authentication.SslProtocols)3072), false);
}
catch (Exception ex)
{
    throw ex;
}

invalid value specified in 'SslProtocolType' enumeration


Solution

  • I solved the enum cast problem by installing the KB4471987 update (in detail on kb4470641).