Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git LFS give x509: certificate signed by unknown authority

Tags:

I have just setup an Ubuntu 18.04 LTS Server with Gitlab following the instructions from https://about.gitlab.com/install/#ubuntu.

I have issued a ssl certificate from GoDaddy and confirmed this works with the Gitlab server.

I have then updated gitlab.rb: gitlab_rails[‘lfs_enabled’] = true

I have installed GIT LFS Client from https://git-lfs.github.com/.

I have then tried to find a solution online on why I do not get LFS to work. I always get

x509: certificate signed by unknown authority

Other settings done in gitlab.rb:

gitlab_workhorse[‘env’] = {
‘SSL_CERT_DIR’ => ‘/opt/gitlab/embedded/ssl/certs/’
}
nginx[‘redirect_http_to_https’] = true

I am not an expert on Linux/Unix/git - but have used Unix/Linux for some 30+ years and git for a number of years - not just setup git with LFS myself before.

like image 906
EON CTO Avatar asked Feb 22 '20 07:02

EON CTO


1 Answers

I just had that same issue while running git clone ... to download source code from a private Git repository in BitBucket into a Docker image. I solved it by disabling the SSL check like so:

GIT_SSL_NO_VERIFY=1 git clone ...

Notice that there is no && between the Environment arg and the git clone command.

You can also set that option using git config:

git config http.sslverify false

For my use case in building a Docker image it is easier to set the Env var.

like image 124
isapir Avatar answered Oct 02 '22 06:10

isapir