Skip to content

Instantly share code, notes, and snippets.

@peschee
Last active April 24, 2024 16:41
Show Gist options
  • Star 30 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save peschee/bbb65746088988fe3a035743804bc63e to your computer and use it in GitHub Desktop.
Save peschee/bbb65746088988fe3a035743804bc63e to your computer and use it in GitHub Desktop.
Disable SSL verification in git repositories with self-signed certificates

Sometimes, we have to access git repositories over SSL and the server only provides a self-signed certificate 🙈. Although there are ways to increase the trust level for the self-signed certificate (https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html, https://confluence.atlassian.com/bitbucketserverkb/resolving-ssl-self-signed-certificate-errors-806029899.html), my recommendation is to just ignore SSL verification alltogether.

Prepend GIT_SSL_NO_VERIFY=true before every git command run to skip SSL verification. This is particularly useful if you haven't checked out the repository yet.

Run git config http.sslVerify false to disable SSL verification if you're working with a checked out repository already.

@luancardosolc
Copy link

Thank you so much!! it helped a lot!!

@scriptonian
Copy link

thanks this helped!

@eliaskanelis
Copy link

While this will work... it is considered a bad practice from security's point of view.
A better approach is to download the self signed certificate into the list of approved certificates in your system.

@thuynguyenit01
Copy link

Thank you so much!

@Quoifeursan
Copy link

thx so much bro <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment