Repository navigation
Proposal: Add --allow-untrusted-signing flag to nuget sign commands - #14798
Merged
kartheekp-ms merged 3 commits intoMar 20, 2026
Merged
Conversation
Add a new --allow-untrusted-signing flag to nuget sign and dotnet nuget sign that allows signing NuGet packages with certificates whose root CA is not installed in a trusted root certificate store. When this flag is set, the UntrustedRoot X509 chain status is treated as a warning instead of a fatal error. The certificate chain is still fully built and validated for structure. Implementation PR: NuGet/NuGet.Client#7201 Co-authored-by: Copilot <[email protected]>
Replace incorrect claims about a nuget verify --allow-untrusted-root CLI flag with accurate references to the allowUntrustedRoot attribute on certificate elements in nuget.config's trustedSigners section. Co-authored-by: Copilot <[email protected]>
dtivel
previously approved these changes
Mar 12, 2026
dtivel
left a comment
Contributor
There was a problem hiding this comment.
Thanks for writing this, @elantiguamsft. I agree with this proposal.
Align CLI flag naming with existing dotnet nuget trust --allow-untrusted-root per reviewer feedback from @kartheekp-ms. The 'signing' word is redundant since the command context already implies signing. Co-authored-by: Copilot <[email protected]>
dtivel
approved these changes
Mar 16, 2026
3 tasks done
kartheekp-ms
approved these changes
Mar 19, 2026
Merged
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new
--allow-untrusted-rootflag tonuget signanddotnet nuget signthat allows signing NuGet packages with certificates whose root CA is not installed in a trusted root certificate store. When this flag is set, theUntrustedRootX509 chain status is treated as a warning instead of a fatal error. The certificate chain is still fully built and validated for structural correctness.Motivation
In enterprise and CI/CD environments, signing certificates are often provisioned from Azure Key Vault where the root CA is not (and should not be) installed into the machine's trusted root certificate store. Installing root CAs requires admin elevation, which fails in non-elevated CI containers and triggers UAC prompts on developer machines.
Today,
nuget signperforms internal chain validation that treatsUntrustedRootas a fatal error with no workaround. Other signing tools (signtool.exe, VsixSigntool) already handle this scenario.Implementation
A reference implementation is available in NuGet/NuGet.Client#7201. The approach:
AllowUntrustedRootboolean toSignArgs,CertificateSourceOptions, andSignPackageRequestGetCertificateChainoverload withallowUntrustedRootparameterUntrustedRootfrom error flags to warning flags inGetChainStatusFlags()--AllowUntrustedSigning(nuget.exe) /--allow-untrusted-signing(dotnet CLI)See the full proposal in
accepted/2026/allow-untrusted-signing.md.