git clone from internal gitlab repository doesn't work unless I'm running as root

Viewed 35

I'm trying to clone an internal gitlab repository, but it keeps giving me this error message

fatal: unable to access 'https://gitlab**************.git/': gnutls_handshake() failed: Error in the pull function.

But somehow, if I'm running as root, the cloning process would run perfectly.

The problem is, I needed this to work because I'm trying to use this repository on Jenkins.

Can someone help me or explain why it only worked if I'm running as root?

1 Answers

root uses the same version of git and curl.

But it does not use the same:

  • global git config: compare the output of git config --global -l in both instances (root and regular user account).
  • environment configuration (type env in both cases, and compare the environment variables)

In particular, look for sslcainfo (git config --global -l|grep -i ssl) which could reference the certificate needed to contact through TLS your on-premise HTTPS GitLab URL.

Related