Skip to content

Commit 96f2655

Browse files
Merge pull request #3505 from NuGet/main
2 parents 3a42769 + 50cc2cd commit 96f2655

14 files changed

+391
-83
lines changed

docs.sln

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.3.11122.13
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docs", "docs\docs.csproj", "{718966AB-D840-C99F-BC8C-757012BE68AA}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C2962E4E-20FC-4C00-858E-D0C62611CBFB}"
9+
ProjectSection(SolutionItems) = preProject
10+
.gitignore = .gitignore
11+
.openpublishing.publish.config.json = .openpublishing.publish.config.json
12+
.openpublishing.redirection.json = .openpublishing.redirection.json
13+
CONTRIBUTING.md = CONTRIBUTING.md
14+
global.json = global.json
15+
LICENSE = LICENSE
16+
LICENSE-CODE = LICENSE-CODE
17+
README.md = README.md
18+
ThirdPartyNotices = ThirdPartyNotices
19+
EndProjectSection
20+
EndProject
21+
Global
22+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
23+
Debug|Any CPU = Debug|Any CPU
24+
Release|Any CPU = Release|Any CPU
25+
EndGlobalSection
26+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
27+
{718966AB-D840-C99F-BC8C-757012BE68AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28+
{718966AB-D840-C99F-BC8C-757012BE68AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
29+
{718966AB-D840-C99F-BC8C-757012BE68AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{718966AB-D840-C99F-BC8C-757012BE68AA}.Release|Any CPU.Build.0 = Release|Any CPU
31+
EndGlobalSection
32+
GlobalSection(SolutionProperties) = preSolution
33+
HideSolutionNode = FALSE
34+
EndGlobalSection
35+
GlobalSection(ExtensibilityGlobals) = postSolution
36+
SolutionGuid = {C4A337AF-69A4-496C-97FF-300C3489A718}
37+
EndGlobalSection
38+
EndGlobal

docs/TOC.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
### [Package Manager Console (PowerShell)](consume-packages/install-use-packages-powershell.md)
1919
## Configure NuGet
2020
### [Visual Studio options](consume-packages/nuget-visual-studio-options.md)
21+
### [NuGet HTTPS Everywhere](consume-packages/nuget-https-everywhere.md)
2122
### Package restore options
2223
#### [Restore packages](consume-packages/package-restore.md)
2324
#### [Troubleshooting](consume-packages/package-restore-troubleshooting.md)

docs/concepts/Auditing-Packages.md

Lines changed: 133 additions & 82 deletions
Large diffs are not rendered by default.

docs/concepts/NuGet-MCP-Server.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,84 @@ To verify that the MCP server is working correctly, open the GitHub Copilot Chat
7373
Then click the Tools icon in the bottom toolbar to bring up the Tools menu.
7474
You should see the MCP server named "nuget" in the list of available servers.
7575

76+
## Getting started in GitHub Copilot Agent
77+
78+
You can also configure the MCP Server to work with GitHub Copilot as a Coding Agent in your repositories.
79+
Ensure that you configured your repository to use [GitHub Copilot Coding Agents](https://github.com/settings/copilot/coding_agent).
80+
81+
Browse to your repository and click the Settings tab.
82+
Expand the Copilot section and click on Coding Agents.
83+
84+
![GitHub Copilot coding agent settings](./media/github-copilot-agent-settings.png)
85+
86+
Scroll down to the **Model Context Protocol (MCP)** section and add the following JSON snippet to your `mcpServers` configuration:
87+
88+
```json
89+
{
90+
"mcpServers": {
91+
"NuGet": {
92+
"type": "local",
93+
"command": "dnx",
94+
"args": ["NuGet.Mcp.Server", "--yes"],
95+
"tools": ["*"],
96+
"env": {}
97+
}
98+
}
99+
}
100+
```
101+
102+
This will make all of NuGet's MCP server tools available. If you want specific tools, you can list them in the `"tools"` parameter array.
103+
104+
Finally, click the **Save MCP configuration** button to save your changes.
105+
106+
Now that the NuGet MCP is configured, you will also need to create a GitHub Actions workflow to install .NET 10 Preview 6 or higher so that the `dnx` command is available to run the MCP server.
107+
You can do this by creating the following workflow file in your repository at
108+
109+
`.github/workflows/copilot-setup-steps.yml`
110+
111+
The contents of this workflow file should be as follows:
112+
113+
```yml
114+
name: "Copilot Setup Steps"
115+
116+
# Automatically run the setup steps when they are changed to allow for easy validation, and
117+
# allow manual testing through the repository's "Actions" tab
118+
on:
119+
workflow_dispatch:
120+
push:
121+
paths:
122+
- .github/workflows/copilot-setup-steps.yml
123+
pull_request:
124+
paths:
125+
- .github/workflows/copilot-setup-steps.yml
126+
127+
jobs:
128+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
129+
copilot-setup-steps:
130+
runs-on: ubuntu-latest
131+
132+
# Set the permissions to the lowest permissions possible needed for your steps.
133+
# Copilot will be given its own token for its operations.
134+
permissions:
135+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
136+
contents: read
137+
138+
# You can define any steps you want, and they will run before the agent starts.
139+
# If you do not check out your code, Copilot will do this for you.
140+
steps:
141+
- name: Install .NET 10.x
142+
uses: actions/setup-dotnet@v5
143+
with:
144+
dotnet-version: |
145+
10.x
146+
dotnet-quality: preview
147+
148+
- name: dotnet --info
149+
run: dotnet --info
150+
```
151+
152+
This will ensure that the `dnx` command is available to run the NuGet MCP server when GitHub Copilot runs as a coding agent in your repository.
153+
76154
## Fixing package vulnerabilities
77155

78156
The NuGet MCP server can help you identify and fix package vulnerabilities in your project.
38.1 KB
Loading
3.68 KB
Loading
19.7 KB
Loading
7.33 KB
Loading
24.6 KB
Loading
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: NuGet HTTPS Everywhere
3+
description: Learn why NuGet enforces HTTPS connections for package sources, what errors like NU1302 mean, and how to safely allow HTTP feeds when necessary.
4+
author: Nigusu-Allehu
5+
ms.author: nyenework
6+
ms.date: 10/28/2025
7+
ms.topic: conceptual
8+
ai-usage: ai-generated
9+
---
10+
11+
# NuGet HTTPS Everywhere
12+
13+
NuGet requires all package sources to use **HTTPS** instead of **HTTP**.
14+
This enforcement protects the software supply chain by preventing tampering and interception during package restore and related operations.
15+
NuGet enforces this requirement by producing an error and stopping the operation when an HTTP source is used.
16+
17+
## Understanding the HTTP Error
18+
19+
This error occurs when one or more package sources in your configuration use an **HTTP** URL instead of **HTTPS**.
20+
21+
In earlier NuGet versions, this scenario produced a **warning** ([`NU1803`](../reference/errors-and-warnings/nu1803.md)).
22+
Beginning with [**NuGet 6.12**](../release-notes/NuGet-6.12.md) and later, it now results in an **error** unless the use of HTTP sources is explicitly permitted.
23+
24+
### Recommended Resolution
25+
26+
Before allowing HTTP connections, confirm whether your package source supports HTTPS.
27+
If it does, update the feed URL to use the secure protocol:
28+
29+
```xml
30+
<add key="MyFeed" value="https://contoso/packages/v3/index.json" />
31+
```
32+
33+
Switching to HTTPS ensures end-to-end encryption and is the recommended and more secure approach.
34+
35+
### Allowing Insecure HTTP Feeds (Opt-Out)
36+
37+
If HTTPS is not available and you operate in a trusted or isolated environment, you can explicitly allow HTTP sources.
38+
39+
#### Option 1: Set allowInsecureConnections in your `NuGet.Config`
40+
41+
* **Use Visual Studio**
42+
43+
Enable or disable allowing insecure HTTP connections with the [Package Sources settings](/nuget/consume-packages/nuget-visual-studio-options#allow-insecure-connections) under the Visual Studio options > **NuGet Package Manager**.
44+
45+
* **Edit `NuGet.Config` manually**
46+
47+
Add the `allowInsecureConnections="true"` attribute to the affected source:
48+
49+
```xml
50+
<?xml version="1.0" encoding="utf-8"?>
51+
<configuration>
52+
<packageSources>
53+
<add key="MyHttpFeed" value="http://contoso/packages/v3/index.json" allowInsecureConnections="true" />
54+
</packageSources>
55+
</configuration>
56+
```
57+
58+
#### Option 2: Use the Command-Line Parameter
59+
60+
For commands that support it, include the following flag to temporarily permit HTTP connections:
61+
62+
For **dotnet** commands:
63+
64+
```bash
65+
--allow-insecure-connections
66+
```
67+
68+
For **NuGet.exe** commands, use:
69+
70+
```powershell
71+
-AllowInsecureConnections
72+
```
73+
74+
#### Commands that support opt-out options
75+
76+
| Tool | Commands | Support for Allow Insecure Connection |
77+
| -------------- | ------------------------- | ------------------------------------- |
78+
| **nuget.exe** | `push` | NuGet **7.0** |
79+
| **dotnet CLI** | `dotnet nuget push` | .NET **10.0.1xx** and newer |
80+
| **dotnet CLI** | `dotnet nuget add source` | .NET **9.0.1xx** and newer |
81+
82+
## HTTPS Enforcement Rollout Across Tools
83+
84+
NuGet’s HTTPS enforcement was introduced gradually across releases.
85+
The following table summarizes the progression from [**warnings (NU1803)**](../reference/errors-and-warnings/nu1803.md) to [**errors (NU1302)**](../reference/errors-and-warnings/nu1302.md).
86+
87+
| Versions Affected | Behavior |
88+
| ----------------------------------------------------- | --------------------------------------------------------------------- |
89+
| [NuGet.exe 6.3](../release-notes/NuGet-6.3.md)+, Visual Studio 17.3+, .NET 6.0.100+ | ⚠️ **Warning (NU1803)** – HTTP sources allowed but discouraged |
90+
| [NuGet.exe 6.12](../release-notes/NuGet-6.12.md)+, Visual Studio 17.12+, .NET 9.0.100+ |**Error (NU1302)** – HTTP sources blocked unless explicitly allowed|
91+
92+
## See Also
93+
94+
* [NU1302](../reference/errors-and-warnings/nu1302.md)
95+
* [NU1803](../reference/errors-and-warnings/nu1803.md)
96+
* [NuGet.Config Reference](../reference/nuget-config-file.md#packagesources)
97+
* [NuGet Visual Studio Options](../consume-packages/nuget-visual-studio-options.md)

0 commit comments

Comments
 (0)