47

I have installed the ssl certificate and key in my git server. But am getting error when i try to clone via https from my mysysgit. Earlier it was working fine with http. Unable to identify where it is failing

$ git clone https://server.name/git/testing.git
Cloning into 'testing'...
* Couldn't find host server.name in the _netrc file; using defaults
* About to connect() to server.name port 443 (#0)
*   Trying server.name...
* Adding handle: conn: 0x274fd60
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x274fd60) send_pipe: 1, recv_pipe: 0
* Connected to server.name(server.name) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Users\user1\AppData\Local\Programs\Git/bin/curl-ca-bundle.crt
  CApath: none
* SSL certificate problem: self signed certificate
* Closing connection 0
fatal: unable to access 'https://server.name/git/testing.git/': SSL certificate problem: self signed certificate
1

3 Answers 3

84

If you are getting an error while doing a git clone, then above needs to be changed to:

git config --global http.sslVerify false
Sign up to request clarification or add additional context in comments.

4 Comments

You should probably never do this globally like this. Do it on a per repo basis without the --global.
Agreed Travis the --global poses a significant security risk.
See the other question/answer stackoverflow.com/questions/11621768/… for how to do this on a per-command basis: git -c http.sslVerify=false clone . . .
Works for: fatal: unable to access 'https://github.com/somerepo.git/': Problem with the SSL CA cert (path? access rights?) `
25

You might have to disable the certificate verification in your case:

cd /path/to/repo
git config http.sslVerify false

(as in "Git: ignore a self signed certificate")

The other option, similar to "Unable to clone Git repository due to self signed certificate" would be to import that certificate into git.

That is: copied it at the end of the file /path/to/git/bin/curl-ca-bundle.crt.

I would not advise git config --global http.sslVerify false, as that would disable certificate verification for all local repositories.

3 Comments

I got => fatal: not in a git directory. What does meaning ?
@Aguid It means you have not executed that command in a local git repository (a folder with a .git subfolder in it)
@Aguid True, but not recommended. See my edited answer.
4

Check your .gitconfig file.

If you've found the following line, Remove it!

[http]
sslCAinfo = /bin/curl-ca-bundle.crt

It worked for me.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.