You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure DevOps 2019中DownloadSecureFile任务下载安全文件失败求助

Azure DevOps 2019 DownloadSecureFile@1任务证书错误解决方法

问题场景

在Azure DevOps 2019的构建过程中,使用DownloadSecureFile@1任务下载安全文件时执行失败,任务配置如下:

- task: DownloadSecureFile@1
  inputs:
    secureFile: 'oimPictureEditor_test'
  displayName: 'download configuration'

错误日志

2022-12-30T10:10:27.9053899Z ##[section]Starten: download configuration
2022-12-30T10:10:28.0009766Z ==============================================================================
2022-12-30T10:10:28.0010142Z Task         : Sichere Datei herunterladen
2022-12-30T10:10:28.0010245Z Description  : Hiermit wird eine sichere Datei an einen temporären Speicherort auf dem Agent-Computer heruntergeladen.
2022-12-30T10:10:28.0010357Z Version      : 1.151.2
2022-12-30T10:10:28.0010489Z Author       : Microsoft Corporation
2022-12-30T10:10:28.0010653Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/download-secure-file
2022-12-30T10:10:28.0010783Z ==============================================================================
2022-12-30T10:10:28.5506559Z ##[error]Error: unable to get local issuer certificate
2022-12-30T10:10:28.5593478Z ##[section]Abschließen: download configuration

解决方法

  • 导入代理根证书到信任存储:如果构建代理处于企业代理环境,将代理的根证书导入到代理机器的系统信任证书库,或者导入到构建代理使用的Node.js证书存储中。
  • 设置NODE_EXTRA_CA_CERTS环境变量:在DownloadSecureFile@1任务前添加前置任务配置环境变量,指定额外CA证书路径:
    Windows环境(PowerShell任务):
    $env:NODE_EXTRA_CA_CERTS = "C:\证书路径\root-ca.crt"
    
    Linux/macOS环境(Bash任务):
    export NODE_EXTRA_CA_CERTS="/证书路径/root-ca.crt"
    
  • 升级代理的Node.js版本:旧版Node.js可能存在证书处理缺陷,将代理上的Node.js升级到兼容Azure DevOps 2019的稳定新版本。
  • 检查代理网络配置:确认构建代理能正常访问Azure DevOps相关端点,防火墙或代理未拦截请求,且代理配置正确传递证书信息。

内容的提问来源于stack exchange,提问作者iiSiggi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 23:10:25