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