我一直在尝试使用 SSH key 从 Gitlab 中提取存储库。所有这些都通过 Ubuntu VM 在 Windows 8 上的命令行中完成。我已将我的公钥添加到我的 Gitlab 帐户,然后将我的私钥添加到 ssh-agent,这样做似乎没有任何错误,但是当我尝试执行 git pull 或 push 时,我遇到了这个问题错误;
fatal: unable to access 'https://git.mgmt.local/XXX/project-name.git/':
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
这让我直接撞到了墙上......不知道出了什么问题,有人能指出我正确的方向吗?
最佳答案
那是因为您使用的是 https 网址。
Https 表示不使用存储在 %HOME%.ssh 中的公钥和私钥。完全没有。
尝试切换到 ssh url:
git remote set-url origin (user)@(ip address):(group)/(project).git
使用标准 GitLab 安装
(user)
应该是 git
.您可以先检查 ssh 是否正在使用:
ssh -Tvvv git@your_server.com
关于Git无法连接Gitlab,SSH验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28783072/