Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not create SSL/TLS secure channel while trying to search for NuGet packages

When I press on "Browse" tab on NuGet packages in Visual Studio, it says "Error occurred" with an error message of

[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json.
  An error occurred while sending the request.
  The request was aborted: Could not create SSL/TLS secure channel.

I have been using Visual Studio and NuGet for a long time and NuGet was working a few days ago. Can someone figure out why this is happening and what I can do to solve it?

Visual Studio 2017 version: 15.9.17

like image 796
M. Azyoksul Avatar asked Nov 22 '19 11:11

M. Azyoksul


1 Answers

NuGet has permanently removed support for TLS 1.0 and 1.1.

Ensure your system uses TLS 1.2.

Run the following commands to enable TLS 1.2 support if it is disabled:

reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:32
reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:64
reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v Enabled /t REG_DWORD /d 1 /f /reg:32
reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v Enabled /t REG_DWORD /d 1 /f /reg:64
like image 109
Vladislav Avatar answered Oct 17 '22 18:10

Vladislav