簡體   English   中英

gnutls_handshake() 失敗:GIT 握手失敗

[英]gnutls_handshake() failed: Handshake failed GIT

一切正常,但突然間我收到錯誤消息:

致命:無法訪問“https://username@bitbucket.org/name/repo_name.git/”:gnutls_handshake() 失敗:握手失敗

我在我的電腦和一個 EC2 實例上得到了這個。 當我在另一台計算機上嘗試時,它在那里工作正常。

我已經嘗試了 Stackoverflow 和其他論壇的許多解決方案。 但沒有任何效果!

在計算機上,os 是 Linux mint 17,在 EC2 實例上,Ubuntu 14.04.6 LTS。

可能是什么問題,我應該怎么做才能解決這個問題?

在裝有 Ubuntu 14.04 的服務器上遇到同樣的問題,發現在 2020 年 8 月 24 日,bitbucket.org 更改為不再允許使用舊密碼,請參閱https://bitbucket.org/blog/update-to-supported-cipher-位桶雲中的套件

這會影響 https:// 到 bitbucket 的連接,但不會影響 ssh 連接,所以對我來說最快的解決方案是向 bitbucket 添加一個 ssh 密鑰,然后將遠程從 https 更改為 ssh。

我從這里找到的更改遙控器的步驟基本上是:

# Find the current remote
git remote -v

origin  https://user@bitbucket.org/reponame.git (fetch)
origin  https://user@bitbucket.org/reponame.git (push)

# Change the remote to ssh
git remote set-url origin git@bitbucket.org:reponame.git

# Check the remote again to make sure it changed
git remote -v

https://community.atlassian.com/t5/Bitbucket-questions/fatal-unable-to-access-https-bitbucket-org-gnutls-handshake/qaq-p/的 Atlassian 論壇上有更多關於這個問題的討論1468075

最快的解決方案是使用SSH而不是HTTPS 我嘗試了其他方法來解決該問題,但沒有奏效。

以下是從SSH替換HTTPS 的步驟:

  1. 在服務器上使用 ssh-keygen生成ssh 密鑰

  2. 從步驟 1 中生成的 id_rsa.pub 文件中復制公鑰,並將其添加到以下鏈接中,具體取決於存儲庫主機 -

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

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

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

  3. 現在運行以下命令從服務器命令行終端測試身份驗證

    比特桶

    ssh -T git@bitbucket.org
    GitHub
     ssh -T git@github.com
    GitLab
     ssh -T git@gitlab.com

  4. 轉到 repo 目錄並使用 emac 或 vi 或 nano 打開 .git/config 文件

  5. 將遠程“來源”URL(以 https 開頭)替換為以下內容 -

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

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

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

sudo bash

mkdir upgrade

cd upgrade

wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz

tar xpvfz openssl-1.1.1g.tar.gz

cd openssl-1.1.1g

./Configure 

make ; make install

cd ..

wget https://curl.haxx.se/download/curl-7.72.0.tar.gz

tar xpvfz curl-7.72.0.tar.gz

cd curl.7.72.0

./configure --with-ssl=/usr/local/ssl

make ; make install

cd ..

git clone https://github.com/git/git 

cd git

vi Makefile, change prefix= line to /usr instead of home

make ; make install

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM