curl
seems to work fine, but git
does not. git
asks for a password, but then doesn't send any credentials.
Works: curl --netrc http://test.git.unsw.edu.au/
and curl -u username:password http://test.git.unsw.edu.au/
Doesn't work: git remote update
Password for 'http://[email protected]':
* Couldn't find host test.git.unsw.edu.au in the .netrc file; using defaults
User-Agent: git/1.7.9.5
Host: test.git.unsw.edu.au
Accept: */*
Pragma: no-cache
Why isn't git
sending credentials?
From an strace, I see:
- Read
.netrc
GET /repo/info/refs?service=git-receive-pack HTTP/1.1
- no credentialsHTTP/1.0 401 Unauthorized
- Read
.netrc
GET /repo/info/refs?service=git-receive-pack HTTP/1.0
- no credentialsHTTP/1.0 401 Unauthorized
- Prompt for password
- Read
.netrc
* Couldn't find host test.git.unsw.edu.au in the .netrc file; using defaults
GET /repo/info/refs?service=git-receive-pack HTTP/1.1
- no credentialsHTTP/1.0 401 Unauthorized
curl -n …
works: sendsAuthorization: Basic …
on the first try (does not even need a 401 first). Butgit push … master
does not send authorization, and when given a 401 and the user enters a password, still does not send authorization. (Git 1.8.1.2 on Linux, connecting to a port on localhost for testing)Negotiate
instead of justBasic
?nc -l -p 8000
or similar to see how Git would send credentials (with the remote being defined ashttp://localhost:8080/
orhttp://bob:secret@localhost:8080/
etc.), but it sent nothing, and I have not managed to convince it to send anything.socat
orstunnel
to decrypt an https connection togithub
, then usewireshark
to monitor whatgit
is doing.WWW-Authenticate
header?