[squid-users] Squid with different HTTP protocol versions

Amos Jeffries squid3 at treenet.co.nz
Mon Jun 15 02:55:24 UTC 2020


On 15/06/20 2:03 pm, Peng Luo wrote:
> Hi,
> 
> I’ve never used Squid until last week. Squid 4.11 has been set as a
> proxy server for my mtk demo board connecting to the internet.
> 
> 
> Recently, when I tried to run CTS on a demo board, few network test
> cases failed. After tcpdumping and investigating with wireshark, it
> seems that the following happens ,
> 
> 1. demo board performs a 'GET' in HTTP 1.0 to the proxy
> 
> 2. the proxy then performs this GET to the server, but now it's in HTTP 1.1
> 
> 3. the server replies in HTTP 1.1 to proxy
> 

This is correct HTTP behaviour as far as the details you have provided show.


> 4. the proxy replies in HTTP 1.1 to the demo board which *expects
> response in HTTP 1.0*
> 

That is broken. It should be expecting a response in HTTP/1.*


The client is telling Squid that it can only support feature level 0. So
responses from Squid can only use *features* compatible with level-0.

Squid is telling the client it supports feature level 1. So the client
can actually *use* features from 1.1 (if it wants/needs to) in its
messages labeled "HTTP/1.0".


<https://tools.ietf.org/html/rfc7230#section-2.6>
"
   When an HTTP/1.1 message is sent to an HTTP/1.0 recipient [RFC1945]
   or a recipient whose version is unknown, the HTTP/1.1 message is
   constructed such that it can be interpreted as a valid HTTP/1.0
   message if all of the newer features are ignored.

...
   Intermediaries that process HTTP messages (i.e., all intermediaries
   other than those acting as tunnels) MUST send their own HTTP-version
   in forwarded messages.
"



Amos


More information about the squid-users mailing list