cURL / Mailing Lists / curl-library / Single Mail


libcurl is unable to load the cookies when constructing a custom HTTP request over IPv6

From: Andrei Cipu <>
Date: Tue, 6 Mar 2012 12:30:13 +0000

Hi all,

We are using libcurl to authenticate to a remote server. In order to do that, we needed to construct a customized HTTP request (including setting our own "Host" header). We were relying on curl to append the cookies received in previous steps to the request. This worked OK on IPv4, but failed on IPv6.

We pinpointed the problem to our custom "Host" header, which was an IPv6 address between [] (e.g. "Host: [2001::1]" - just like libcurl was sending for non-custom requests). The cookie domain was determined from this host by removing the part after ':' which was considered the port, leaving us with a host of "[2001", which did not match the domain in the cookie repository.

I'm attaching a bug that solved this problem, and possibly also solves the bug reported by mailsvb in September 2011 ( ). This patch is made on libcurl 7.24.0.

   Andrei Cipu

List admin:

Received on 2012-03-06