无法在詹金斯上安装.pfx证书

时间:2020-10-12 09:01:17

标签: jenkins vpn keytool pfx pkcs#12

我必须从专用网络上的git repo签出。我已经在系统上安装了必需的pfx证书,并且在提示中输入密码后连接到VPN时,可以使用命令行获取/克隆存储库。但是,我无法在詹金斯上做到这一点。我尝试在Jenkins凭证管理器中安装pfx,但文件甚至没有上传。 Jenkins不再提供vpn插件支持。有办法吗?

ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe fetch --tags --force --progress -- ssh://root@10.247.186.70/srv/git/leaveRepo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: ssh: connect to host 10.247.186.70 port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

1 个答案:

答案 0 :(得分:0)

摘自文档:

  • 如果使用ssh协议访问远程git存储库,则该凭据必须是私钥凭据。
  • 如果使用http或https协议访问远程git存储库,则该凭据必须是用户名/密码凭据。

因此,您应该从pfx捆绑包中导出私钥,并使用SSH username with private key类型的凭据将其添加到Jenkins。