gitubuntu-20.04gnutls

gnutls handshake failed over git clone


When i try to clone , pull or push using git i am getting following error:

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

I tried by using 'GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1' and i got the following details:

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

Solution

  • Access denied due to proxy issuse, possible solution

    1. Clone the repository from outside firewall
    2. Clone the repository using ssh instead of https

    SSH

    Step 1. Set up your default identity

    1. Open Terminal (Ctrl + Alt + T) and enter the following command to set up your default identity ssh-keygen

      Eg:

    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. Press enter to accept the default key and path, /c/Users//.ssh/id_rsa.
    2. Enter and re-enter a passphrase when prompted.The command creates your default identity with its public and private keys. The whole interaction looks similar to this:
    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]-----+
    

    Step 2 Add the public key to your Account settings

    1. Copy your public key using the following command cat ~/.ssh/id_rsa.pub
    2. Add it to your account
    3. Return to your terminal and clone the repository using ssh git@github.com:M-Thirumal/installation_guide.git