diff --git a/docs/reference/errors-and-warnings/NU1302.md b/docs/reference/errors-and-warnings/NU1302.md index 989cef448..592a4ff99 100644 --- a/docs/reference/errors-and-warnings/NU1302.md +++ b/docs/reference/errors-and-warnings/NU1302.md @@ -8,14 +8,38 @@ f1_keywords: - "NU1302" --- -# NuGet Warning NU1302 +# NuGet Error NU1302 > You are running the 'restore' operation with an 'HTTP' source: myHttpSource. NuGet requires HTTPS sources. To use an HTTP source, you must explicitly set 'allowInsecureConnections' to true in your NuGet.Config file. Please refer to https://aka.ms/nuget-https-everywhere for more information. ### Issue -`myHttpSource` is an insecure HTTP source. We recommend using HTTPS sources instead. +`myHttpSource` is an insecure HTTP source. We recommend using an HTTPS sources instead. ### Solution -This can be fixed either by removing the HTTP source or disabling HTTP Errors for the specific source by using `allowInsecureConnections` option in your [NuGet config file](../../reference/nuget-config-file.md). +#### Option 1: Update the Source to Use HTTPS +If possible, update the package source to use `https://` instead of `http://`: +```xml + + + + + +``` +#### Option 2: Allow Insecure Connections (If Necessary) +If the source must remain HTTP, explicitly allow insecure connections by adding the `AllowInsecureConnections` flag in the `NuGet.Config`: +```xml + + + + + +``` + +#### Option 3: Consult SDK Analysis Level +Ensure that the project’s `SdkAnalysisLevel` allows HTTP sources: +- SDK versions **below 9.0.100** generate a warning (NU1803). +- SDK versions **9.0.100 or higher** enforce the error (NU1302) unless `AllowInsecureConnections` is explicitly enabled. + +Check the `SdkAnalysisLevel` of your project and upgrade or adjust settings as necessary.