0 votes
1 view
in Devops and Agile by (16.9k points)

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

1 Answer

0 votes
by (22.3k points)

You can set GIT_SSL_NO_VERIFY to true:

GIT_SSL_NO_VERIFY=true git clone https://example.com/path/to/git

or alternatively configure Git not to verify the connection on the command line:

git -c http.sslVerify=false clone https://example.com/path/to/git

...