Squid with different HTTP protocol versions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Squid with different HTTP protocol versions

Frank Law

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

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


At first I was thinking I chose the wrong server which doesn’t support HTTP 1.0. So I used my laptop to send exactly the same 'GET' to this server. It replied in HTTP 1.0.

Now the problem is, when my squid proxy communicating to server , it cannot use the same HTTP protocol version as it communicating to  client. Why?


I tried to find similar problems in the forum. But all I found were more than ten years ago.

I suppose I must miss something in configuration of squid.

Please help, thanks in advance.


best regards
Frank Law


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Squid with different HTTP protocol versions

Amos Jeffries
Administrator
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
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users