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

Re: git clone with basic auth in url directly returns authentication failure after 401 received under some git versions

From
Jeff King <peff@peff.net>
Date
Aug 22, 2022, 09:07 UTC
Message-ID
<YwNHVfvb10VD2ROe@coredump.intra.peff.net>
In-Reply-To
<CADmGLV0F==7ep-xZKd2crZLi8JnFBFVkdX9Bi2T63NECcSAbVw@mail.gmail.com>
On Mon, Aug 22, 2022 at 11:35:10AM +0800, 王小建 wrote:
Show 7 quoted lines
> Thank you very much for your answer!
> And now I tried to add CURLOPT_UNRESTRICTED_AUTH  but it failed.
> Here are a few examples of what I've tried.
> 1. docker run -it -e CURLOPT_UNRESTRICTED_AUTH=1  5de1a96efc49  clone
> http://xxx:xxx@xxx/xxx/xxx
> 2. echo CURLOPT_UNRESTRICTED_AUTH=1 > $HOME/.curlrc
> I wonder if it's the way I'm trying to do it wrong

That won't work. CURLOPT_UNRESTRICTED_AUTH isn't an environment variable, but rather a flag that Git could pass to libcurl via curl_easy_setopt(). So we'd probably wire it up in Git to a config option. I'd prefer not to unless there is a compelling reason, though. The documentation would have to come with a big warning/disclaimer, which is a good sign that we may be better off without the option entirely. :)

-Peff
Previous: 王小建Next: Jeff King
Message 6 of 9 in “git clone with basic auth in url directly returns authentication failure after 401 received under some git versions”
  1. 王小建Aug 20, 2022
  2. Jeff KingAug 20, 2022
  3. 王小建Aug 20, 2022
  4. Daniel StenbergAug 20, 2022
  5. 王小建Aug 22, 2022
  6. Jeff KingAug 22, 2022
  7. Jeff KingAug 22, 2022
  8. brian m. carlsonAug 22, 2022
  9. Jeff KingAug 23, 2022

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.