[asterisk-dev] [Code Review]: func_curl: make it report errors like "server certificate verification failed" instead of returning silently

Tilghman Lesher reviewboard at asterisk.org
Tue Mar 19 10:34:05 CDT 2013



> On March 19, 2013, 10:31 a.m., Tilghman Lesher wrote:
> > /branches/1.8/funcs/func_curl.c, line 643
> > <https://reviewboard.asterisk.org/r/2403/diff/2/?file=34835#file34835line643>
> >
> >     It's not clear from the documented libcurl API that this will do what you expect.  The API suggests that you should instead be using CURLOPT_STDERR to turn off the buffer.

As an addendum, I realize that you tested this, but given that the API is not documented that way, it could be changed in the future, and we'd be wrong for assuming that it would always work this way.  I think I'd prefer if we used the API as documented, rather than making assumptions.


- Tilghman


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2403/#review8087
-----------------------------------------------------------


On March 19, 2013, 7:10 a.m., wdoekes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2403/
> -----------------------------------------------------------
> 
> (Updated March 19, 2013, 7:10 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Failed CURL() requests would be quite silent.
> 
> Now you get nice warnings like this:
> 
>   WARNING[6701]: func_curl.c:654 acf_curl_helper: server certificate verification failed. \
>     CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none ('https://ORIGINAL_URL')
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/funcs/func_curl.c 383308 
> 
> Diff: https://reviewboard.asterisk.org/r/2403/diff
> 
> 
> Testing
> -------
> 
> It works.
> 
> I also tested that setting CURLOPT_ERRORBUFFER to NULL does what you'd expect. (And the cast is to silent the fancy gcc type checks.)
> 
> 
> Thanks,
> 
> wdoekes
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130319/2b322f3b/attachment-0001.htm>


More information about the asterisk-dev mailing list