gnutls 握手失败 git 克隆

gnutls handshake failed over git clone

当我尝试使用 git 克隆、拉取或推送时,出现以下错误:

fatal: unable to access 'https://bitbucket.org/***-team/****.git/': gnutls_handshake() failed: Access was denied

我尝试使用 'GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1' 并获得了以下详细信息:

16:11:00.756726 git.c:439               trace: built-in: git clone https://******S@bitbucket.org/*****-team/****.git
Cloning into '****'...
16:11:00.760746 run-command.c:663       trace: run_command: git-remote-https origin https://******S@bitbucket.org/****-team/****.git
* Couldn't find host bitbucket.org in the .netrc file; using defaults
*   Trying 18.205.93.2:443...
* TCP_NODELAY set
* Connected to bitbucket.org (18.205.93.2) port 443 (#0)
* found 385 certificates in /etc/ssl/certs
* ALPN, offering h2
* ALPN, offering http/1.1
* gnutls_handshake() failed: Access was denied
* Closing connection 0
fatal: unable to access 'https://bitbucket.org/INDSolv-team/icms.git/': gnutls_handshake() failed: Access was denied

由于代理问题导致访问被拒绝,可能的解决方案

  1. 从外部克隆存储库 firewall
  2. 使用 ssh 而不是 https
  3. 克隆存储库

SSH

第 1 步。设置您的默认身份

  1. 打开终端(Ctrl + Alt + T)并输入以下命令以设置您的默认身份 ssh-keygen

    例如:

thirumal@thirumal:~/git$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/thirumal/.ssh/id_rsa): 
  1. 按回车接受默认密钥和路径,/c/Users//.ssh/id_rsa.
  2. 当 prompted.The 命令使用其 public 和私钥创建您的默认身份时,输入并重新输入密码。整个交互看起来类似于:
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/thirumal/.ssh/id_rsa
Your public key has been saved in /home/thirumal/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:h4xKiyvxzOWkeXcwxmkAYSZ9AsDOikB14+vgzpTnjPs thirumal@thirumal
The key's randomart image is:
+---[RSA 3072]----+
|*o=o o           |
| *+ + .          |
|+  + .           |
|.o  . .o .       |
|+  ..+..S .      |
|+ .o*oB  .       |
| =.Xo= o         |
|. X.B . .        |
| ..*oE .         |
+----[SHA256]-----+

第 2 步将 public 密钥添加到您的帐户设置

  1. 使用以下命令复制您的 public 密钥 cat ~/.ssh/id_rsa.pub
  2. 将其添加到您的帐户
  3. Return 到您的终端并使用 ssh git@github.com:M-Thirumal/installation_guide.git
  4. 克隆存储库