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

Re: Handle HTTP error 511 Network Authentication Required (standard secure proxy authentification/captive portal detection)

From
Jeff King <peff@peff.net>
Date
Feb 20, 2012, 15:44 UTC
Message-ID
<20120220154452.GA27456@sigill.intra.peff.net>
In-Reply-To
<e1d3ddd965eb32717163aaa87fa71e17.squirrel@arekh.dyndns.org>
On Mon, Feb 20, 2012 at 04:34:19PM +0100, Nicolas Mailhot wrote:
Show 8 quoted lines
> >> Actually, the best would be to launch something capable of interpreting html
> >> forms on the url given by the error.
> >
> > Doing that portably is near impossible (keep in mind that git runs on
> > things like antique versions of Solaris).
> 
> Can't the you let the user specify a browser command (firefox, elinks w3m) to
> auto-feed the portal page to when needed ?

Yes, that's why I said "we could add a configuration option" in the part that you snipped. But doing it out of the box is not going to be portable.

> The main problem with captive portals is when they shut down the connection
> and the user has no idea how to restore it (and error 511 is intended to fix
> this, but that won't do a lot of good if the user does is not shown the
> captive portal url transmitted with the error)
In my experience, the captive portal process usually goes like this:
  1. Connect to network.
  2. Try some non-browser command. Wonder why in the world it isn't
     working.
  3. Open a browser and say "Ah, I see. A captive portal".

The 511 proposal makes step 2 a lot better if the protocol is http[1]. But it pretty much makes it better even without non-browser client support, because at least you will get a 511 error instead of having git complain that the remote repository is corrupted (which happens if the captive portal returns a redirect to an html page).

We should already be doing that. Adding more support could make step 3 a little nicer, but like I said, I'd be more interested in seeing a real case first. It may even be a feature that would be more appropriate to curl (which git builds on for http access).

-Peff
[1] Of course it doesn't help at all for git:// or ssh:// (which are
    usually even worse off in the first place, as many captive portals
    will simply drop the packets, making it look like the remote server
    is down).
Previous: Nicolas MailhotNext: Nicolas Mailhot
Message 6 of 14 in “Handle HTTP error 511 Network Authentication Required (standard secure proxy authentification/captive portal detection)”
  1. Nicolas MailhotFeb 19, 2012
  2. Jeff KingFeb 20, 2012
  3. Nicolas MailhotFeb 20, 2012
  4. Jeff KingFeb 20, 2012
  5. Nicolas MailhotFeb 20, 2012
  6. Jeff KingFeb 20, 2012
  7. Nicolas MailhotFeb 20, 2012
  8. Jeff KingFeb 20, 2012
  9. Nicolas MailhotFeb 20, 2012
  10. Jeff KingFeb 20, 2012
  11. Nicolas MailhotFeb 20, 2012
  12. Daniel StenbergFeb 20, 2012
  13. Jeff KingFeb 20, 2012
  14. Junio C HamanoFeb 20, 2012

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.