Share via


Cannot Restore Packages; Nuget Certificate Invalid, But Re-validates Sometimes After Reset

Question

Thursday, March 22, 2018 5:47 AM | 1 vote

I've been experience an issue where I cannot restore packages from Nuget, as per the error message below.

Error occurred while restoring NuGet packages: Unable to load the service index for source https://api.nuget.org/v3/index.json.
[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 underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.*
The remote certificate is invalid according to the validation procedure.*

However, if I reset my PC, most of the time the issue magically goes away and I can restore packages again... for a time.

For a bit of background information, I was experiencing another issue attempting to build a C# project in Visual Studio 2017 that creates service and that service runs on my local account. The project was built correctly, but the service failed to start due to my account not authenticating with the domain due to the unreasons of another service, "NetLogin", which is supposed to be automatic on startup, was disabled and preventing my access to the domain... however, before I diagnosed the issue was due to this "NetLogin" service, I 'system restored' Windows. The system restore corrupted Visual Studio, to which I reinstalled it, and after reinstalling it, a number of Visual Studio extensions, including NUnitAdapter3 and Viasfora, became corrupt. They appeared installed but behaved as if they're not installed.

All replies (3)

Thursday, March 22, 2018 8:51 AM | 2 votes

Hi FuzzyDiceRolledSixes,

Welcome to the MSDN forum.

Do you have proxy configured on your machine? Or "http_proxy" variable configured in environment variable?

You need to add proxy settings into Nuget.Config file. Refer to this link for details: Nuget Config Section & Nuget Proxy Settings.

More information, please refer to following threads:

# Nuget connection attempt failed “Unable to load the service index for source”

#Package Manager Error: Unable to load the service index for source (bad proxy settings)

Regards,

Judyzh

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Monday, March 26, 2018 12:13 AM

Thanks. This looks promising.

To come to think of it, very recently, I've noticed some websites are being blocked at work. Perhaps our new nanny state is to blame...


Monday, March 26, 2018 3:02 AM

Hi FuzzyDiceRolledSixes,

Glad receive your reply.

If my reply could help you, could you please mark it as an answer, this will help other community members who encounter the same issue with you.

Thanks for your understanding.

Regards,

Judyzh

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].