git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Default authentication over https?

From
Jeff King <peff@peff.net>
Date
Apr 13, 2016, 22:36 UTC
Message-ID
<20160413223613.GB10011@sigill.intra.peff.net>
In-Reply-To
<CAPf1peAW11hZpN6_ztA62tcu6mgCfV3VwwjjtXT5yySUPD9Qpw@mail.gmail.com>
On Mon, Apr 11, 2016 at 12:04:02PM -0400, Isaac Levy wrote:
Show 5 quoted lines
> I use a git server which requires authentication over https. Git seems
> determined to always try an unauthenticated request first, slowing
> down operations by a couple seconds.
> 
> Is there a way to configure git to default to authenticated requests?  Thanks!

No, there isn't. Very old versions of git would ask for the password if you provided a username, but since v1.7.8 we only do so in response to an HTTP 401. The code is still there to do the "proactive" asking, but it's not wired up to any particular config option.

However, I don't think even that would give you what you want. Because I think that even if we provide a credential, curl will make an initial request (presumably to find out which auth type it should use, but that is just a guess). I don't know if there is a way to convince curl to stick the credential in the first request (if my guess is right, then perhaps by setting the auth type explicitly, or even by sticking in our own Authorization header).

So I think the answer for now is "no", but it might be possible (and not even that hard) to do with a patch.

-Peff
Previous: Isaac LevyNext: Daniel Stenberg
Message 2 of 7 in “Default authentication over https?”
  1. Isaac LevyApr 11, 2016
  2. Jeff KingApr 13, 2016
  3. Daniel StenbergApr 14, 2016
  4. Isaac LevyApr 14, 2016
  5. Jeff KingApr 15, 2016
  6. Jeff KingApr 15, 2016
  7. brian m. carlsonApr 15, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.