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

问题描述

我必须从专用网络上的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.

解决方法

摘自文档:

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

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...