git失败,“gnutls_handshake()失败”

时间:2013-11-05 16:21:35

标签: git ssl openssl gnutls

昨天我用新的Ubuntu 12.04 LTS图像设置了一台新服务器。我在1.7.9.5版本中安装了git-core。现在,我通过尝试克隆现有存储库来获得以下错误:

error: gnutls_handshake() failed: An unexpected TLS packet was received. while accessing https://github.com/***/***/info/refs
fatal: HTTP request failed

我已经读过,原因可能是错误的证书,但是当我直接连接到没有任何防火墙/代理的互联网时,怎么会发生这种情况呢?

1 个答案:

答案 0 :(得分:0)

您将要检查.git / config文件,并确保github具有您的公共ssh密钥(位于〜/ .ssh / id_rsa.pub或〜/ .ssh / id_dsa.pub)。我的.git / config文件如下所示(用户名和回购应与您相关):

[core]
    repositoryformatversion = 0
    filemode = true
    logallrefupdates = true
[remote "origin"]
    url = https://github.com/username/repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master