Updating Legacy ASP.NET Applications to support TLS 1.2

Updating Legacy ASP.NET Applications to support TLS 1.2

TLS

The Transport Layer Security (TLS) protocol is an industry standard designed to help protect the privacy of information communicated over the Internet. TLS 1.2 is a standard that provides security improvements over previous versions. TLS 1.2 will eventually be replaced by the newest released standard TLS 1.3 which is faster and has improved security. 

Many large companies are still in the process of disabling the outdated SSL 3 and TLS 1.0 security protocols on their servers. Regulations in the Payment Card Industry (PCI) demand that by June 30th 2018 only TLS 1.1 and TLS 1.2 may be enabled. These changes might impact your code even if it is not under the scope of PCI compliance (i.e. some 3rd party APIs may no longer support TLS 1.0). 

If your app targets .NET Framework 3.5

If you must explicitly set a security protocol instead of letting the .NET framework or the OS pick the security protocol, add SecurityProtocolTypeExtensions and SslProtocolsExtension enumerations to your code. SecurityProtocolTypeExtensions and SslProtocolsExtension include values for Tls12, Tls11, and the SystemDefault value. See "Support for TLS System Default Versions included in .NET Framework 3.5 on Windows 8.1 and Windows Server 2012 R2" / "Solution" found below under "Primary References". 

You may need to perform an update to your Windows Server by installing a Microsoft patch and modifying some system Registry keys. However, you may already have received a Windows update that superseeds these patches. Before updating Windows, first try to implement "Solution" / "Developer Guidance" (see bellow) to see if the Windows update is required. 

Solution

If you must explicitly set a security protocol instead of letting the .NET framework or the OS pick the security protocol, add SecurityProtocolTypeExtensions and SslProtocolsExtension enumerations to your code. SecurityProtocolTypeExtensions and SslProtocolsExtension include values for Tls12, Tls11, and the SystemDefault value.

Windows may or may not need updating. The article provides Microsoft Download Center links. The patch you require may just just be a matter of having SecurityProtocolTypeExtensions.cs and SslProtocolsExtensions.cs placed in App_Code, and then updaing the code (i.e. Global.asax Application_Start) to have: 

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

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;
	}
} 

SslProtocolsExtensions.cs

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


References

Primary References (Microsoft Support): 

Secondary References: 

Tertiary References: 

要查看或添加评论,请登录

Richard Harris的更多文章

  • Using Linux on Windows via WSL

    Using Linux on Windows via WSL

    Contents Overview of Windows Subsystem for Linux Setup (including Windows PowerShell Commands for WSL & Linux Shell…

  • Cloud Computing QuickStart Guide

    Cloud Computing QuickStart Guide

    Overview Cloud computing is on-demand access (via the internet) to computing resources — applications, servers…

    2 条评论
  • Software Development & Technology News (01/08/2021 - 25/11/2021 )

    Software Development & Technology News (01/08/2021 - 25/11/2021 )

    Googling for Software Development- What Developers Search For and What They Find · It Will Never Work in Theory Why…

    1 条评论
  • Software Development & Technology News (09/02/2021 - 31/07/2021)

    Software Development & Technology News (09/02/2021 - 31/07/2021)

    Do business leaders know how to evaluate developer success- - ZDNet Will Artificial Intelligence Be the End of Web…

  • Azure Infrastructure | IaaS Day Recap

    Azure Infrastructure | IaaS Day Recap

    Today (17/11/2021) I attended Microsoft's Azure IaaS Day, which was delivered in partnership with Intel. In case you…

  • Microsoft SQL Server

    Microsoft SQL Server

    Introduction MS SQL Server is a Relational Database Management System (RDBMS) developed by Microsoft. It provides GUI…

    1 条评论
  • Custom Software Development: Project Initiation

    Custom Software Development: Project Initiation

    Need a custom app built? I can make your vision a reality! We'd begin with Requirements Gathering, Planning, and…

  • Software Development Life Cycle (SDLC)

    Software Development Life Cycle (SDLC)

    Overview The Software Development Life Cycle (SDLC) is a systematic process that development teams use to produce…

    2 条评论
  • LinkedIn Learning Paths: Computer Science

    LinkedIn Learning Paths: Computer Science

    In my past article Best of LinkedIn Learning: Computer Science, I reviewed the Courses offered by LinkedIn Learning…

  • Glossary of Database Terms

    Glossary of Database Terms

    Use the terms and definitions below to better understand Relational Database concepts. Actors: An actor is a model…

    1 条评论

社区洞察

其他会员也浏览了