[asterisk-bugs] [JIRA] (ASTERISK-17491) CURLOPT() needs a "followlocation" parameter / "maxredirs" doesn't do anything

Steven T. Wheeler (JIRA) noreply at issues.asterisk.org
Wed Apr 20 09:50:56 CDT 2016


     [ https://issues.asterisk.org/jira/browse/ASTERISK-17491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven T. Wheeler updated ASTERISK-17491:
-----------------------------------------

    Attachment: ast11_func_curl_redirects_and_tls.patch

Here's a patch which fixes this issue in Asterisk 11 (certified-asterisk-11.6-cert11 to be specific).

This adds two new options to the CURLOPT() function:
* {{followlocation}} Whether or not to follow any Location header in a HTTP 3xx response. This accepts boolean values.
* {{sslversion}} Set the preferred SSL/TLS version. This accepts the following values:
**  {{default}} Use the cURL default setting.
** {{tlsv1}} Use TLSv1.x.
** {{sslv2}} Use SSLv2.
** {{sslv3}} Use SSLv3.
**  {{tlsv1.0}} Use TLSv1.0, added in cURL v7.34.0.
**  {{tlsv1.1}} Use TLSv1.1, added in cURL v7.34.0.
**  {{tlsv1.2}} Use TLSv1.2, added in cURL v7.34.0.

> CURLOPT() needs a "followlocation" parameter / "maxredirs" doesn't do anything
> ------------------------------------------------------------------------------
>
>                 Key: ASTERISK-17491
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-17491
>             Project: Asterisk
>          Issue Type: New Feature
>          Components: Functions/func_curl
>    Affects Versions: 1.8.3
>            Reporter: candrews
>         Attachments: ast11_func_curl_redirects_and_tls.patch
>
>
> I noticed that the CURL function will not follow redirects. According to http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTFOLLOWLOCATION you need to set the CURLOPT_FOLLOWLOCATION in order for CURL to follow redirects, and that is not set according to the source code: http://svnview.digium.com/svn/asterisk/trunk/funcs/func_curl.c?view=markup
> This is especially interesting seeing as how there is a "maxredirs" CURLOPT parameter. According to the CURL documentation at http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTMAXREDIR :
> "This option only makes sense if the CURLOPT_FOLLOWLOCATION is used at the same time."
> I suggest that a new CURLOPT parameter "followlocation" be added to add the redirect following feature and fix the currently broken "maxredirs" option.
> ****** ADDITIONAL INFORMATION ******
> Note that this is not a feature request - "maxredirect" (which already exists) is currently broken - and I'm suggesting a way to fix that.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list