0

We have an on premise instance of DevOps Server 2020. I have a dotnet standard 2.0 library that I am trying to push to our internal nuget feed.

I am getting the error unable to get local issuer certificate. I followed the instructions here:Azure DevOps Server pipeline build fails when using self-signed SSL certificate with "unable to get local issuer certificate" during NuGet restore

But now I am getting the error (node:6056) Warning: Ignoring extra certs from C:\Certs\root.crt, load failed: error:02001003:system library:fopen:No such process

Here is the YAML where I am setting the path to the root cert:

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
  NODE.EXTRA.CA.CERTS: 'C:\Certs\root.crt'

And here is the YAML where I am packing and pushing the Nuget package:

- task: DotNetCoreCLI@2
  inputs:
    command: 'pack'
    packagesToPack: '**/*.csproj'
    versioningScheme: 'off'

- task: DotNetCoreCLI@2
  inputs:
    command: 'push'
    packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
    nuGetFeedType: 'internal'
    publishVstsFeed: 'b4b089f9-ff2f-4b74-9690-ec6082a4872b'
Dbloom
  • 1,302
  • 3
  • 18
  • 45
  • I did get this working by using the NuGetCommand@2 task. I confess I don't know why it works over the DotNetCoreCLI@2 task. I fought with it all day and made so many changes I don't know which one worked. – Dbloom Apr 16 '21 at 15:14

1 Answers1

1

unable to get local issuer certificate

To resolve this issue, you could try to manually acquire the version of NuGet.exe you wish to use (like nuget.exe v5.9.1) and put it on the private agent in a folder that's on the PATH.

  • Download NuGet.exe tool to that agent machine manually(e.g. d:\tool\nuget.exe).
  • Open System Properties window > Advance > Environment variables.
  • In System variables section, click New button > Variable name: nuget; Variable value: d:\tool > Click Ok.
  • Select Path variable > Edit > add/append %nuget% item (the result will be xxxx;%nuget%) Restart your machine.

After that you can remove NuGet Tool Installer task from build definition.

If it not work for you, try to running ".\externals\nuget\nuget.exe update -self" for the private agent install folder on the agent machine and getting an update version, it works again with the local certificate store:

enter image description here

You could check this thread for some more details.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135