我在使用Jenkins自动化部署项目的时候,出现了如下的错误
error NU3028: Package 'System.IO.Compression 4.3.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain [/var/jenkins_home/workspace/BiliFor/BiliFor.sln]
/var/jenkins_home/workspace/BiliFor/BiliFor.Repository/BiliFor.Repository.csproj : error NU3037: Package 'System.IO.Compression 4.3.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature validity period has expired. [/var/jenkins_home/workspace/BiliFor/BiliFor.sln]
/var/jenkins_home/workspace/BiliFor/BiliFor.Tasks/BiliFor.Tasks.csproj : error NU3028: Package 'Serilog.Sinks.File 4.1.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain [/var/jenkins_home/workspace/BiliFor/BiliFor.sln]
/var/jenkins_home/workspace/BiliFor/BiliFor.Tasks/BiliFor.Tasks.csproj : error NU3037: Package 'Serilog.Sinks.File 4.1.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature validity period has expired. [/var/jenkins_home/workspace/BiliFor/BiliFor.sln]
/var/jenkins_home/workspace/BiliFor/BiliFor.Common/BiliFor.Common.csproj : error NU3028: Package 'Microsoft.Extensions.Configuration 2.1.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain [/var/jenkins_home/workspace/BiliFor/BiliFor.sln]
/var/jenkins_home/workspace/BiliFor/BiliFor.Common/BiliFor.Common.csproj : error NU3037: Package 'Microsoft.Extensions.Configuration 2.1.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature validity period has expired. [/var/jenkins_home/workspace/BiliFor/BiliFor.sln]
/var/jenkins_home/workspace/BiliFor/BiliFor.Common/BiliFor.Common.csproj : error NU3028: Package 'Microsoft.Extensions.Configuration 2.1.0' from source 'https://api.nuget.org/v3/index.json': The repository countersignature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain [/var/jenkins_home/workspace/BiliFor/BiliFor.sln]
/var/jenkins_home/workspace/BiliFor/BiliFor.Common/BiliFor.Common.csproj : error NU3037: Package 'Microsoft.Extensions.Configuration 2.1.0' from source 'https://api.nuget.org/v3/index.json': The repository countersignature validity period has expired. [/var/jenkins_home/workspace/BiliFor/BiliFor.sln]
查询了很多帖子最后发现是微软没有通过认证不允许拉取的问题
我们通过命令进入到jenkins镜像
docker exec -it jenkins容器id /bin/sh
然后执行
curl -o /usr/local/share/ca-certificates/verisign.crt -SsL https://crt.sh/?d=1039083 && update-ca-certificates
完成后我们重新去构建项目
此时已经没有报错了