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

Re: Default authentication over https?

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Apr 15, 2016, 23:02 UTC
Message-ID
<20160415230217.GC140502@vauxhall.crustytoothpaste.net>
In-Reply-To
<20160415224334.GA32160@sigill.intra.peff.net>
On Fri, Apr 15, 2016 at 06:43:35PM -0400, Jeff King wrote:
Show 27 quoted lines
> Hmm. Looks like we already pull this out of the curl result for other
> reasons, but we never feed it back in to the next request. So if I do
> this:
> 
> diff --git a/http.c b/http.c
> index 9bedad7..add9bf2 100644
> --- a/http.c
> +++ b/http.c
> @@ -1132,6 +1132,8 @@ static int handle_curl_result(struct slot_results *results)
>  			return HTTP_NOAUTH;
>  		} else {
>  #ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
> +			if (results->auth_avail)
> +				http_auth_methods = results->auth_avail;
>  			http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
>  #endif
>  			return HTTP_REAUTH;
> 
> that drops my test case down to two requests: once to find out that we
> need auth via the 401, and then we feed curl sufficient information to
> do the followup in a single request (the GSSNEGOTIATE thing there is a
> hack from 4dbe664, which we can ignore for now).
> 
> Interestingly, curl _does_ reuse the connection this time. I'm still not
> sure why it didn't in the original case. But this means the whole thing
> is happening over a single TCP session, which is good (and I didn't have
> to change my config at all).

This looks fine from my point of view. GSS-Negotiate and Digest are going to require at least one round-trip because they need the token or nonce to authenticate. Basic shouldn't, though.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: https://keybase.io/bk2204
Previous: Jeff King
Message 7 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.