- See configure Git to accept a particular self-signed server certificate for a particular https remote
- From Resolving SSL Self-Signed Certificate Errors:
Use exported certificate in git commands
Once the certificate is saved on the client you can instruct your git client to use it to trust the remote repository:
# Initial clone GIT_SSL_CAINFO=/path/to/certificate.pem git clone https://username@git.example.com/scm/repository.git # Ensure all future interactions with origin remote also work cd repository git config http.sslCAInfo /path/to/certificate.pem