Running "dotnet restore" fails intermittently due to expired signature
- Dominant language
- PowerShell
- Stars
- 22k
- Forks
- 4.9k
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 29
Description
### Description
I have been having an intermittent issue for a few months with `dotnet restore`. It will occasionally fail because:
> The repository primary signature's timestamping certificate is not trusted by the trust provider.
One of the packages that trigger this issue is `runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.0` and its certificate expired on "14/04/2021 14:00:00".
These packages are included because I'm using `XUnit.Assert 2.4.2`, which targets `netstandard1.1`, which includes `System.Net.Http 4.3.0`.
[I've made a very simple project that replicates this issue.](https://github.com/julian94/RestoreProblemReproduction)
The troubling thing with this issue is that it's intermittent, it will only trigger on the first fetch of a package from nuget. Running `dotnet restore` again after a failed attempt will succeed. This can be used as a workaround, but indicates that package signatures are only verified when downloaded, and then trusted afterwards.
### Configuration
Reproduced using DotNet SDK `6.0.307` & `7.0.102`.
Using Windows Server 2022 Standard with all windows updates applied.
### Regression?
### Other information
[Here's a full diagnostic log of dotnet restore.](https://pastebin.com/FKQAkMRN)
A simple workaround is to run `dotnet restore` again if it fails the first time.
Contributor guide
Assessment
This issue has not been assessed yet.