User Tools

Site Tools


Tips and Tricks : Git

Git With Self-Signed SSL Certificate

First you need to fetch the certificate. Assuming that the repository resides at https://git.localhost.localdomain/foobar.git that is achieved by

openssl s_client -connect git.localhost.localdomain:443 | \
awk '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/' > \

Now you can clone the repository using

GIT_SSL_CAINFO=./git.localhost.localdomain.crt git clone https://git.localhost.localdomain/foobar.git

Once the repository has been checked out move the certificate file to it's final location:

mv ./git.localhost.localdomain.crt ./foobar/.git

Now change into the foobar directory and issue

git config http.sslCAinfo $(echo "$PWD/.git/git.localhost.localdomain.crt")
tips_and_tricks/git.txt · Last modified: 2020/09/09 21:58 by jupp