gnutls_handshake()失败:握手失败GIT [英] gnutls_handshake() failed: Handshake failed GIT

查看:90
本文介绍了gnutls_handshake()失败:握手失败GIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一切正常,但突然我收到错误消息:

Everything was working fine but suddenly I am getting the error:

致命:无法访问'https://username@bitbucket.org/name/repo_name.git/':gnutls_handshake()失败:握手失败

fatal: unable to access 'https://username@bitbucket.org/name/repo_name.git/': gnutls_handshake() failed: Handshake failed

我正在计算机和EC2实例上获取此信息.当我在另一台计算机上尝试过时,它在那儿工作正常.

I am getting this on my computer as well as an EC2 instance. When I tried on another computer then it is working fine there.

我已经尝试了Stackoverflow和其他论坛的许多解决方案.但没有任何效果!

I have tried many solutions from Stackoverflow and from other forums. but nothing worked!

在计算机上,操作系统是Linux Mint 17,在EC2实例上是Ubuntu 14.04.6 LTS.

On the computer, os is Linux mint 17 and on EC2 instance, Ubuntu 14.04.6 LTS.

可能是问题所在,我应该怎么做才能解决此问题?

What can be the issue and what should I do to fix this issue?

推荐答案

最快的解决方案是使用 SSH 而不是 HTTPS .我尝试了其他方法来解决此问题,但无法正常工作.

The quickest solution is to use SSH instead of HTTPS. I tried other ways to fix the issue but it was not working.

以下是从 SSH 替换 HTTPS 的步骤:

  1. 使用ssh-keygen生成 ssh密钥在服务器上.

从步骤1中生成的id_rsa.pub文件中复制公钥,并根据存储库主机在以下链接中添加公钥-

Copy the public key from the generated id_rsa.pub file from step 1 and add it at following links depending on the repository host -

Bitbucket- https://bitbucket.org/account/settings/ssh-keys/

Bitbucket - https://bitbucket.org/account/settings/ssh-keys/

Github- https://github.com/settings/ssh/new

Gitlab- https://gitlab.com/profile/keys

现在运行以下命令以从服务器命令行终端测试身份验证

Now run the following command to test authentication from the server command line terminal

Bitbucket

ssh -T git@bitbucket.org

Github

ssh -T git@github.com

Gitlab

ssh -T git@gitlab.com

转到repo目录,然后使用emac或vi或nano打开.git/config文件

Go to the repo directory and open .git/config file using emac or vi or nano

替换远程原点"带有以下内容的URL(以https开头)-

Replace remote "origin" URL (which starts with https) with the following -

对于 Bitbucket -git@bitbucket.org:<用户名>/< repo> .git

For Bitbucket - git@bitbucket.org:<username>/<repo>.git

对于 Github -git@github.com:< username>/< repo> .git

For Github - git@github.com:<username>/<repo>.git

对于 Gitlab -git@gitlab.com:<用户名>/< repo> .git

For Gitlab - git@gitlab.com:<username>/<repo>.git

这篇关于gnutls_handshake()失败:握手失败GIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆