Moha Logiciels Banner

Icon

C:\Tutorials\How to enable TLS encryption in .NET Framework 4

X

Top Go back to folder Tutorials

How to enable TLS encryption in .NET Framework 4

In this tutorial, you will learn how to enable TLS encryption in .NET Framework 4 to make older software work properly with modern servers—for example to make legacy Visual Studio versions connecting successfully to Microsoft servers again, to get updates or NuGet packages.

Table of contents


Video tutorial

Info Click here to read the tutorial as text

Thumbnail

Info Your browser does not support video playback. Please click on here to download this video to your computer.


Problem

If you use an older version of Visual Studio, like 2012 and 2013, or any other software based on .NET Framework 4, it won’t work properly with online connections to servers requiring TLS encryption, as it is disabled by default. If you want to get updates and packages for your projects in Visual Studio, you will need to apply this fix too, as Microsoft servers require a TLS 1.2-encrypted connection to their servers since 2020.

Fortunately, it can be easily fixed!

Example

How to fix

Warning This fix involves changing the Windows Registry, which can cause Windows to stop working properly when doing anything else than described here. If you are unsure about applying this fix, contact your system administrator, or download the .REG file here to apply this fix without changing the registry yourself.

  1. Open Registry Editor
    • First, you have to open Windows Registry Editor. To do that, there are multiple ways: either by searching for Registry Editor in the Start Menu, or simply by typing regedit.exe in the Run dialogue, which can be accessed by pressing the
      Windows Key
      +
      R
      keys. Click on OK afterwards.
      Open Run dialogue
    • If the UAC Prompt appears, click on Yes. If needed, type in your/the administrator’s password.
      UAC prompt
  2. Create DWORD values
    • In the Registry Editor, navigate to following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319
    • It will look like this:
      Registry key
    • Now, add two DWORD values called SchUseStrongCrypto and SystemDefaultTlsVersions – if they already exist, skip next two steps – by right-clicking on an empty space on the right panel, then go to New and click on DWORD (32-bit) Value, to type in the names afterwards.
      New DWORD Value
    • Those two keys should look like this:
      New values
    • Now, you need to change both values. Do that by double-clicking on each those values, and change them from 0 to 1 in the textbox under Value data:Info
      Changing values
  3. For 64-bit users: Do the same in Wow6432Node
    • If you have a 64-bit operating system, which applies to most users nowadays, you have to repeat Step 2, but do it at following registry hive: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319
  4. Restart your computer
    • It is recommended to restart your computer now. Even though it did work without restart in my virtual machine, a restart makes it surely work if the entries have been applied correctly.
  5. Et voilà !
    • It should be done now.
    • If you have Visual Studio, open it now and check if NuGet Package Manager can retrieve the information from Microsofts servers—you may also check other software.
      NuGet Package Manager loading succeeded

Download fix

If you want to apply this fix quickly, or just do not want to change anything in the Registry yourself, download the correct file for your platform. After downloading it, open the file, click on Yes if the UAC appears, and confirm to apply the changes by clicking on Yes.

top

This website is hosted on a Windows Server—many thanks to MonsterASP.net for supplying this service!