A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
NU1301 indicates that restore cannot access the configured package source. In this case, the private Artifactory feed is failing during the HTTPS request and the remote host is closing the connection.
To resolve, focus on the package source configuration and connectivity:
- Verify the Artifactory feed URL
- Open the
NuGet.Config(ornuget.config) used by the solution (in the solution folder or user-level config) and confirm that the<packageSources>entry for the Artifactory feed has the correct URL and is reachable. - If this feed is no longer valid or needed, remove or disable it from the configuration and retry restore. NU1301 is raised when a configured source is unavailable.
- Open the
- Check for failed/invalid sources
- NU1301 is raised when
IgnoreFailedSourcesis not enabled and a source cannot be read. Either:- Fix the Artifactory source (URL, DNS, SSL/TLS, proxy, firewall, or authentication), or
- Remove that source from
NuGet.Configif it is not required for this solution.
- NU1301 is raised when
- Validate network and TLS/proxy settings
- The message “An existing connection was forcibly closed by the remote host” typically indicates a network, TLS, or proxy termination issue. Ensure that:
- The machine can reach the Artifactory URL (test via browser or curl).
- Any corporate proxy/firewall allows outbound HTTPS to the Artifactory host.
- TLS protocol versions and ciphers required by Artifactory are enabled on the client.
- The message “An existing connection was forcibly closed by the remote host” typically indicates a network, TLS, or proxy termination issue. Ensure that:
- Confirm credentials for the private feed
- If the Artifactory feed requires authentication, ensure valid credentials are configured in
NuGet.Config(for example, via<packageSourceCredentials>or a credential provider) and that they have not expired.
- If the Artifactory feed requires authentication, ensure valid credentials are configured in
- Check for transient issues and retry
- If the problem is intermittent, use the latest NuGet/.NET client and, if applicable, configure enhanced retry behavior (for CI scenarios) using the environment variables described in the NuGet.org FAQ (for example,
NUGET_ENHANCED_MAX_NETWORK_TRY_COUNTandNUGET_ENHANCED_NETWORK_RETRY_DELAY_MILLISECONDS).
- If the problem is intermittent, use the latest NuGet/.NET client and, if applicable, configure enhanced retry behavior (for CI scenarios) using the environment variables described in the NuGet.org FAQ (for example,
- Update NuGet client if needed
- Ensure a current NuGet client is used, as older clients can have networking and protocol issues that affect secure feeds.
If the Artifactory source is required and all local configuration appears correct, involve the Artifactory administrator to check server-side logs for why the connection is being closed.
References: