cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: actual version: HTTP redirect -> https target

From: Harald Latzko <root_at_c-works.net>
Date: Thu, 21 Mar 2013 09:27:37 +0100

Hello GŁn,

Am 21.03.2013 um 01:09 schrieb Guenter <lists_at_gknw.net>:

>> curl_global_init(CURL_GLOBAL_ALL);
>> 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?
> option params are long [1]; try:
> curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
>
> GŁn.
>
> [1] http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
I tried this now, but without success. In older versions, (i.e. 7.19.x, 7.20.x) this functionality worked, even without the CURLOPT_REDIR_PROTOCOLS parameter. I made an update to CURL 7.29.0 due to the security flaw mentioned in february (see http://www.h-online.com/open/news/item/cURL-goes-wrong-1800880.html). Maybe the handling in this version differs from older versions from now on?

Harald
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-21