cURL / Mailing Lists / curl-library / Single Mail


actual version: HTTP redirect -> https target

From: Harald Latzko <>
Date: Wed, 20 Mar 2013 19:10:39 +0100


I'm using the latest version of CURL 7.29.0 under Mac OS X and Linux 64bit in C. I'm trying to fetch a resource from the following URL:

Using wget shows that the ressource shows a HTTP302, the new location is

localhost:Downloads haraldlatzko$ wget ""
--2013-03-20 13:51:12--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 302 Object Moved
Location: [following]
--2013-03-20 13:51:13--
Connecting to||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 741 [application/pkix-crl]
Saving to: `COMCERT Root.crl.2'

CURL shows that a HTTP error 302 occurred (okay, this is correct), but using an older version (i.e. 7.20.0), the target is being retrieved in the moved target. I'm using the curl handle the following way:

            curl_handle = curl_easy_init();
            curl_easy_setopt(curl_handle, CURLOPT_URL, url);
            curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1);
            curl_easy_setopt(curl_handle, CURLOPT_FAILONERROR, 1);
            curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
            curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
            curl_easy_setopt(curl_handle, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);

So I would expect that the target ressource would be retrieved successfully, but I'm receiveing an HTTP 302 return code. What am I doing wrong?


List admin:
Received on 2013-03-20