Using Git, is there a way to tell it to accept a self signed certificate?
I am using an https server to host a git server but for now the certificate is self signed.
When I try to create the repo there for the first time:
git push origin master -f
I get the error:
error: Cannot access URL
https://the server/git.aspx/PocketReferences/, return code 22
fatal: git-http-push failed
To permanently accept a specific certificate
Try
http.sslCAPathorhttp.sslCAInfo. Adam Spiers’s answer gives some great examples. This is the most secure solution to the question.To disable TLS/SSL verification for a single git command
try passing
-ctogitwith the proper config variable, or use Flow’s answer:To disable SSL verification for all repositories
It is possible to globally deactivate ssl verification. It is highly recommended to NOT do this but it is mentioned for completeness:
There are quite a few SSL configuration options in
git. From the man page ofgit config:A few other useful SSL configuration options: