[OpenSIPS-Users] Support for https in async

Liviu Chircu liviu at opensips.org
Tue Nov 15 16:41:40 CET 2016


Just make sure "libcurl-gnutls-dev"is uninstalled. Should do the trick.

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 15.11.2016 17:34, Ramachandran, Agalya (Contractor) wrote:
>
> Hi Liviu,
>
> How can I point to opensips to use "libcurl-openssl-dev" instead of 
> “gnutls-dev” -?
>
> Would be great if you guide me here.
>
> Regards,
> Agalya
>
> *From:*Liviu Chircu [mailto:liviu at opensips.org]
> *Sent:* Tuesday, November 08, 2016 12:29 PM
> *To:* Ramachandran, Agalya (Contractor) 
> <Agalya_Ramachandran at comcast.com>; OpenSIPS users mailling list 
> <users at lists.opensips.org>
> *Subject:* Re: Support for https in async
>
> Hi Agalya!
>
> > handle https queries
>
> Regarding HTTPS queries, could you try to build your rest_client with 
> "libcurl-openssl-dev" instead of "libcurl-gnutls-dev" as a possible fix?
>
> >why is curl_multi_wait is not used
>
> We don't want to block OpenSIPS after issuing an async query, but 
> rather use the core async interface in order to quickly resume 
> processing the next SIP message.
>
> >What is the use of read_fds[] in rest_methods.c
>
> Helps us find the needle in the haystack. If we find the needle (i.e. 
> the new fd), we can throw it into the reactor and successfully exit. 
> Otherwise, the connect operation is still going, and we need to wait a 
> bit more.
>
> > Why select() is not used ?
>
> We don't want to do select() in the module code. The core reactor 
> already does that for us. The module's only job in the async pattern 
> is to produce file descriptors and feed them to the core async engine.
>
> Regards,
>
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
> On 08.11.2016 19:10, Ramachandran, Agalya (Contractor) wrote:
>
>     Hi Liviu,
>
>     Thank you for response. I have few questions, can you please
>     clarify me on these.
>
>     ·Is there is a roadmap in future targeting async() to handle https
>     queries?
>
>     ·In start_async_http_request(), why is curl_multi_wait is not used
>     to overcome 1024 fds limitation? and is there plan to use it in
>     future?
>
>     ·What is the use of read_fds[] in rest_methods.c and who uses it?
>
>     ·Why select() is not used ?
>
>     Regards,
>
>     Agalya
>
>     *From:*Liviu Chircu [mailto:liviu at opensips.org]
>     *Sent:* Monday, October 31, 2016 12:27 PM
>     *To:* Ramachandran, Agalya (Contractor)
>     <Agalya_Ramachandran at comcast.com>
>     <mailto:Agalya_Ramachandran at comcast.com>; OpenSIPS users mailling
>     list <users at lists.opensips.org> <mailto:users at lists.opensips.org>
>     *Subject:* Re: Support for https in async
>
>     Hi, Agalya!
>
>     We have not done any development in that direction, and I assume
>     it won't work out of the box, as we need to instruct libcurl on
>     where to find the CA certificate before we can expect it to
>     establish the TLS connection. As an alternative, we could add the
>     option of disabling host/peer verifications like here [1]
>
>     [1]: https://curl.haxx.se/libcurl/c/https.html
>     <https://curl.haxx.se/libcurl/c/https.html>
>
>     Liviu Chircu
>
>     OpenSIPS Developer
>
>     http://www.opensips-solutions.com
>
>     On 31.10.2016 16:41, Ramachandran, Agalya (Contractor) wrote:
>
>         Hi team,
>
>         Have you tried with *https://url*with async and does that work
>         without issue ?
>
>         When I try, resume_async_http_req is called, but crash is
>         occurring at libcurl library. So helpless to debug further.
>
>         async(rest_put(*"https://url" <https://url>, *"$fU,$tU,$ci ",
>         "application/json", "$var(body)", "$var(ct)",
>         "$var(rcode)"),resume);
>
>         My question is crash occring only in my scenario or  OpenSIPS
>         doesn’t support async as https?
>
>         Here is my dump just in case for reference.
>
>         /#0 0x00007f567248da1e in Curl_raw_nequal () from
>         /lib64/libcurl.so.4/
>
>         /#1 0x00007f567245bd0f in Curl_checkheaders () from
>         /lib64/libcurl.so.4/
>
>         /#2 0x00007f567245d1e5 in Curl_http () from /lib64/libcurl.so.4/
>
>         /#3 0x00007f567246db4b in Curl_do () from /lib64/libcurl.so.4/
>
>         /#4 0x00007f567247da1b in multi_runsingle () from
>         /lib64/libcurl.so.4/
>
>         /#5 0x00007f567247e121 in curl_multi_perform () from
>         /lib64/libcurl.so.4/
>
>         #6 0x00007f56726b75ca in resume_async_http_req (fd=9,
>         msg=0x7f56739c0640 <faked_req.10404>, _param=0x7f56b3e354d0)
>
>             at rest_methods.c:380
>
>         #7 0x00007f56737771ff in t_resume_async (fd=0x7f56b3e26840,
>         param=0x7f567405c3e8) at async.c:125
>
>         #8 0x0000000000509975 in handle_io (fm=0x7f56b3e26840, idx=1,
>         event_type=1) at net/net_udp.c:267
>
>         #9 0x00000000005082b3 in io_wait_loop_epoll (h=0x806e00
>         <_worker_io>, t=1, repeat=0) at net/../io_wait_loop.h:221
>
>         #10 0x0000000000509c30 in udp_rcv_loop (si=0x7f56b3dd6808) at
>         net/net_udp.c:308
>
>         #11 0x000000000050a1c8 in udp_start_processes
>         (chd_rank=0x7d30e8 <chd_rank.10706>, startup_done=0x0) at
>         net/net_udp.c:372
>
>         #12 0x0000000000492304 in main_loop () at main.c:671
>
>         #13 0x0000000000494d8f in main (argc=7, argv=0x7fff38a979f8)
>         at main.c:1261
>
>         Regards,
>
>         Agalya
>
>         *From:* Ramachandran, Agalya (Contractor)
>         *Sent:* Thursday, October 27, 2016 4:24 PM
>         *To:* users at lists.opensips.org
>         <mailto:users at lists.opensips.org>; 'Liviu Chircu'
>         <liviu at opensips.org> <mailto:liviu at opensips.org>
>         *Subject:* Support for https in async
>
>         Hi team,
>
>         Just a quick question.. Does async(), method supports https
>         request?
>
>         When I try to use https, resume_async_http_req is called, but
>         I never got the response and rather OpenSIPS crashed at libcurl.
>
>         Regards,
>         Agalya
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20161115/689e60d8/attachment-0001.htm>


More information about the Users mailing list