Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

on mac git clone over https fails to authentication

On a mac mini with Mavericks I am having problems authenticating when I try to git clone from a private git server. I have installed and configured git on Windows and Ubuntu a few times with this same server and haven't this sort of problem before. I'm at a loss as to what to try next.

Symptoms:

git clone https://[email protected]:8448/git/libs/project.git
Cloning into 'project' ...
Password for 'https://[email protected]:8448': [1] note
fatal: Authentication failed for 'https://[email protected]:8448/git/libs/project.git'

[1] I am not asked for this on other systems. I believe I have configured my git client to not ask for passwords. No password I provide is good at this prompt

I have this in my ~/.gitconfig:

[http]
        sslKey = /Users/macuser/auth/username.key
        sslCert = /Users/macuser/auth/username.pem
        sslVerify = false
[user]
        name = username
        email = [email protected]

I received the following files when setting up my client certificates which I placed in a folder named ~/auth:

username.cer
username.p12
username.pem
ca.cer

I ran this command to generate the key file:

openssl rsa -in /Users/macuser/auth/username.pem -out /Users/macuser/auth/username.key

And then I ran git config commands such as:

git config --global http.sslKey /Users/macuser/auth/username.key
git config --global http.sslCert /Users/macuser/auth/username.pem
git config --global http.sslVerify false

After configuring git just like the steps above, on other systems when I do a 'git clone https' it just works. On OS X Mavericks with Xcode command line tools installed, git cannot authenticate.

What am I doing wrong?

Thanks in advance.

Edit:

I thought I'd add this piece of information. The server is using a self signed certificate, or one which comes from no authority. This is why I set http.sslVerify to false.

Here are the verbose clone commands. The setups on Linux and Mac are the same, save for auth folder locations. The Linux version succeeds while the Mac version fails.

http://cache.codebot.org/stackoverflow/linux-git-works.txt
http://cache.codebot.org/stackoverflow/mac-git-fails.txt

Answer:

sudo port install git-core
like image 512
sysrpl Avatar asked Nov 01 '22 11:11

sysrpl


1 Answers

The solution was to use the macports version of git rather than using the version included with Xcode command line tools.

sudo port install git-core
like image 77
sysrpl Avatar answered Nov 08 '22 03:11

sysrpl