cURL / Mailing Lists / curl-library / Single Mail


Re: CURLOPT_HTTP_VERSION doesn't work?

From: A. Craig West <>
Date: Tue, 6 Jan 2009 18:11:03 -0500

2009/1/6 Daniel Stenberg <>:
> On Tue, 6 Jan 2009, A. Craig West wrote:
>> Here is a patch that sets the HTTP version for the CONNECT string with a
>> proxy, based on the same heuristics as used elsewhere in the code.
> First, this patch will break all test cases that test CONNECT.
> Then, I'm slightly concerned about what this change may introduce. You're
> mentioning a case where the 1.0-stuff wasn't liked by a proxy, but curl has
> done it this way for some *10* years without it ever having caused problems
> before (to my knowledge). This gives me a fear that swapping over to
> defaulting to 1.1 for CONNECT, or even defaulting the CONNECT request to use
> the same HTTP version as the host request use, may in fact be somewhat of a
> big change that we should think twice before we introduce.
> Perhaps we should allow the CONNECT request to use a separate HTTP version
> set by a separate option? It would allow us to continue defaulting that to
> 1.0 while still allowing it to be changed to 1.1 by clients that want that?
> Or am I just too cautious here?

I used the use_http_1_1 function that was already in the code, as it
makes sense in this case too. From what I can tell, it uses 1.1 or 1.0
if the user has explicitly set that version as an option, otherwise,
it will use the version that the proxy server has claimed to support.
I don't see any reasonable cases where this could fail, and it is a
lot more standards compliant. From what I can determine, CONNECT with
HTTP/1.0 is part of a proposed extension to http 1.0, as CONNECT
itself didn't become part of the standard until 1.1, so the servers
are well within their rights to refuse it. It seems rude, I will
admit, as there is a general principle of being generous with what you
accept and strict with what you send...
It might be worth changing the code to use 1.0 if the server is
already claiming to be 1.0, even if the setting is 1.1, but I am
pretty sure the connection is doomed to fail in that case

Received on 2009-01-07