AW: 400 Bad request mit squid

Kai Krebber Kai.Krebber at krick.net
Fri Oct 9 16:29:05 CEST 2009


5.1.2, ja?

Ich wusste doch, dass ich was übersehen hatte. Danke für's Augen öffnen.
Der alte Proxy hatte sich die URL wohl selbst aus dem Pfad- und dem Host-Teil zusammengebaut.

Und den Mailclient habe ich auf 'plain text' umgestellt - hoffe, das war's.

Gruß,
Kai

-----Ursprüngliche Nachricht-----
Von: Jan-Benedict Glaw [mailto:jbglaw at lug-owl.de] 
Gesendet: Freitag, 9. Oktober 2009 15:57
An: Kai Krebber
Cc: lug-owl.de at lug-owl.de
Betreff: Re: 400 Bad request mit squid

On Fri, 2009-10-09 09:37:49 +0200, Kai Krebber <Kai.Krebber at krick.net> wrote:
> Wir haben einen squid webproxy (3.0.STABLE6) in Betrieb genommen und 
> nun klappen einige automatisierte http-checks nicht mehr.
> Mitsniffen ergibt:
> 
>  
> GET / HTTP/1.1
> User-Agent:blabla
> Host: 82.100.230.226
>  
> 
> HTTP/1.0 400 Bad Request
> Server: squid/3.0.STABLE6

Mit einem Web Proxy sprichst Du nicht direkt HTTP, bzw. in der URI nicht so, wie Du einen HTTP-Server angehen würdest.

> M.E. ist der Request gem. rfc 2616 korrekt. Hier steht ja:
> 
> ' The most common form of Request-URI is that used to identify a
>    resource on an origin server or gateway. In this case the absolute
>    path of the URI MUST be transmitted (see section 3.2.1, abs_path) as
>    the Request-URI, and the network location of the URI (authority) MUST
>    be transmitted in a Host header field. For example, a client wishing
>    to retrieve the resource above directly from the origin server would
>    create a TCP connection to port 80 of the host "www.w3.org" and send
>    the lines:
>  
>        GET /pub/WWW/TheProject.html HTTP/1.1
>        Host: www.w3.org
>  
>    followed by the remainder of the Request. Note that the absolute path
>    cannot be empty; if none is present in the original URI, it MUST be
>    given as "/" (the server root).'

5.1.2: [...] The absoluteURI form is REQUIRED when the request is being made to a proxy. [...]

> Ich könnte also meine checks umschreiben, aber hätte gerne das 
> Verhalten des Squid verstanden. Kann mir da jemand auf die Sprünge 
> helfen?

Einem Proxy *mußt* Du eine absolute URI geben. Macht ja auch Sinn.
Wenn Dein Client HTTP/1.0 wäre, würde das "Host:"-Feld fehlen und der Proxy hätte keine Chance, herauszufinden, von wo die Daten eigentlich kommen sollen.

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw at lug-owl.de              +49-172-7608481
Signature of:                 Friends are relatives you make for yourself.
the second  :


More information about the Linux mailing list