Hello again. It seems I found the answer to my question. Yes, really Git client requires 'WWW-Authenticate: Basic' when gets 401 response. Without this, Git won't send credentials.
воскресенье, 15 октября 2023 г. в 12:24:13 UTC+3, Artem: > Hello everyone! > > I'm playing with the JGit library over the Jetty server and can't > understand why Git cannot send basic authentication credentials. > > $ git push > Username for 'http://localhost:8080': qwerty > Password for 'http://qwerty@localhost:8080': > fatal: Authentication failed for 'http://localhost:8080/repo1/' > > Wireshark captures such HTTP request that does not contain the > Authorization header: > > GET /repo1/info/refs?service=git-receive-pack HTTP/1.1 > Host: localhost:8080 > User-Agent: git/2.39.3 (Apple Git-145) > Accept: */* > Accept-Encoding: deflate, gzip > Pragma: no-cache > > I thought it could be related to insecure HTTP, but upgrading to HTTPS > changes nothing. Am I doing something wrong? Should my server send the > correct headers with a 401 response? > > Thanks in advance, > Artem > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/3a795066-0072-4f31-9c25-206d552af798n%40googlegroups.com.