Git can't connect to Gitlab, SSH verification error

点点圈 提交于 2019-12-08 05:00:30

问题


I've been trying to pull down a repository from Gitlab using SSH keys. All done in command line on Windows 8 via a Ubuntu VM. I've added my public key to my Gitlab account and then added my private key to the ssh-agent and didn't seem to have any errors in doing so but when I try and do a git pull or push I run in to this error;

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

And that's run me straight in to a wall ... no idea on what's wrong, can anyone point me in the right direction?


回答1:


That is because you are using an https url.

Https means the public and private ssh keys stored in %HOME%.ssh are not used. At all.

Try switching to an ssh url:

git remote set-url origin (user)@(ip address):(group)/(project).git

With a standard GitLab installation (user) should be git.

You can check first if ssh is working with:

ssh -Tvvv git@your_server.com


来源:https://stackoverflow.com/questions/28783072/git-cant-connect-to-gitlab-ssh-verification-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!