Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to trust a certificate with “PfxFilePath” in net9.0 command #14178

Open
v-luzh opened this issue Mar 12, 2025 · 0 comments
Open

Failed to trust a certificate with “PfxFilePath” in net9.0 command #14178

v-luzh opened this issue Mar 12, 2025 · 0 comments
Labels
Found:ManualTests Priority:1 High priority issues that must be resolved in the current sprint. Type:Test

Comments

@v-luzh
Copy link

v-luzh commented Mar 12, 2025

NuGet Product Used

dotnet.exe

Product Version

.NET SDK 9.0.300-preview.0.25161.8

Worked before?

It is a regression since it doesn't repro on VS Main\35612.67 after patching the latest 8.0.405-servicing.24605.1 .NET SDK with NuGet Client Dev\6.13.0.95

Impact

It's more difficult to complete my work

Repro Steps & Context

Repro Steps:

  1. Patch dotnet SDK: Patch dotnet SDK.
  2. Go to the patchedSDK folder and create a new test certificate:
    .\dotnet run --project .\Entropy\MakeTestCert\MakeTestCert.csproj --framework net9.0
  3. Where is the file path to the created certificate (in step1) .pfx file, add trust for the certificate:
    .\dotnet run --project .\Entropy\TrustTestCert\TrustTestCert.csproj --framework net9.0 -- add -c <PfxFilePath>

Expected:

Trusting the certificate with “PfxFilePath” should be successful.

Actual:

Trusting the certificate with “PfxFilePath” is failed as the screenshot below.
Image

Verbose Logs

`.\dotnet run --project .\Entropy\TrustTestCert\TrustTestCert.csproj --framework net9.0 -- add -c "C:\Users\v-luzh\Desktop\PatchedSDK\4bb88d4cad0a022a05bd10d637d6da7658e45705.pfx"`
System.Security.Cryptography.CryptographicException: Cannot find the requested object.
   at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadCertificate(CertQueryObjectType objectType, Void* pvObject)
   at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadCertificateFromFile(String path)
   at TrustTestCert.Program.MainCore(String[] args) in C:\Users\v-luzh\Desktop\PatchedSDK\Entropy\TrustTestCert\Program.cs:line 73
   at TrustTestCert.Program.Main(String[] args) in C:\Users\v-luzh\Desktop\PatchedSDK\Entropy\TrustTestCert\Program.cs:line 19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Found:ManualTests Priority:1 High priority issues that must be resolved in the current sprint. Type:Test
Projects
None yet
Development

No branches or pull requests

2 participants