NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

[Cross-platform Dotnet Nuget Sign] No certificate info shows when running dotnet nuget sign on default verbosity #11173

Open v-luzh opened 3 years ago

v-luzh commented 3 years ago

Details about Problem

NuGet version: NuGet Client Dev\6.0.0.204 VS Version: Main\31617.326 OS: Windows-10-Enterprise-21H1

Detailed repro steps

  1. Git clone https://github.com/NuGet/Entropy.git to Windows VM.
  2. Copy the “SDKPatchTool” folder from https://github.com/NuGet/Entropy.git to the desktop of Linux VM.
  3. Copy the “Nupkgs” folder of the NuGet build to the desktop of Linux VM.
  4. Go to the “SDKPatchTool” folder on Linux, and edit the paths in the “patchOnUnix.ps1”.
  5. Open a bash on Linux, cd to the “SDKPatchTool” folder path and run “patchOnUnix.ps1” script:./patchOnUnix.ps1.
  6. On Windows VM, create a C# Class Library (.NET 6.0) project and pack it with command dotnet pack.
  7. On Windows VM, cd to \TestCertGenerator and create a new test certificate: .\CreateTestCertificate.ps1 -AddAsTrustedRootAuthority -Password password -GenerateCerFile in powershell.
  8. Copy the “*.nupkg” file (created in step6), “.cer” file and the “.pfx” file from the above Windows machine to Linux machine.
  9. Change the .cer to .crt format: openssl x509 -inform DER -in <.cer file path> -out <.crt file path> on Linux
  10. Add the certificate(.crt) to trusted store on Linux:
      cd /usr/local/share/ca-certificates/ 
      sudo cp <.crt file path>  ./ 
      sudo chmod 644 ./<.crt file name> 
      sudo update-ca-certificates 
  11. Run./dotnet nuget sign <PackageFilePath> --certificate-path <PfxFilePath> --certificate-password password on Linux.

    Expected Result

    There is certificate info when signing with Dotnet Nuget Sign Command.

    Actual Result

    No certificate info show when signing with Dotnet Nuget Sign Command as below screenshot. image

    Notes:

    1.It is not a regression since it’s a new feature. 2.It repro on Linux/Windows/Mac. 3.Workaround: add an option “-v n” at the end of the signing command.

nkolev92 commented 3 years ago

@v-luzh I was not able to repro this on Windows.

Can you post the output from dotnet nuget verify please?

Please copy the console values instead of a screenshot. Thanks!

v-luzh commented 3 years ago

Hi @nkolev92, sorry, this bug just repro when signing, doesn't repro when verifying. Updated the bug.

heng-liu commented 3 years ago

As per comments, it would be better to confirm with both NuGet PM and the .NET CLI PMs about the verbosities.

v-luzh commented 2 months ago

It still reproes on .NET SDK Version: 8.0.400-rtm.24367.3 patched with Dev\6.12.0.33