<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Agalya!</p>
    <p><span style="color:#1F497D">&gt; handle https queries</span></p>
    <p><tt>Regarding HTTPS<tt> queries, could you try to build your
          rest_client with "libcurl-openss<tt>l-dev" instead of "l<tt>ibcurl-gnutls-dev"<tt><tt>
                  as a possible fix?</tt></tt></tt></tt></tt></tt></p>
    <p><tt><tt><tt><tt><tt><tt><tt></tt></tt>&gt; </tt></tt></tt></tt></tt><span
        style="color:#1F497D">why is curl_multi_wait is not used</span></p>
    <p>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.</p>
    <p><span style="color:#1F497D">&gt; </span><span
        style="font-family:Symbol;color:#1F497D"><span
          style="mso-list:Ignore"><span style="font:7.0pt &quot;Times
            New Roman&quot;"> 
          </span></span></span><span style="color:#1F497D">What is the
        use of read_fds[] in rest_methods.c</span></p>
    <p>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.</p>
    <p><span style="color:#1F497D">&gt; </span><span
        style="color:#1F497D">Why select() is not used ?</span></p>
    <p>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.</p>
    <p><span style="color:#1F497D"><font color="#000000">Regards,</font><br>
      </span></p>
    <pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 08.11.2016 19:10, Ramachandran,
      Agalya (Contractor) wrote:<br>
    </div>
    <blockquote
      cite="mid:b5bc2e1f6a9646a18a46b23ef0080c3f@COPDCEX28.cable.comcast.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:910654852;
        mso-list-type:hybrid;
        mso-list-template-ids:214177932 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Hi Liviu, <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Thank you for
            response. I have few questions, can you please clarify me on
            these.
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoListParagraph"
          style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
            style="font-family:Symbol;color:#1F497D"><span
              style="mso-list:Ignore">·<span style="font:7.0pt
                &quot;Times New Roman&quot;">        
              </span></span></span><!--[endif]--><span
            style="color:#1F497D">Is there is a roadmap in future
            targeting async() to handle https queries?<o:p></o:p></span></p>
        <p class="MsoListParagraph"
          style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
            style="font-family:Symbol;color:#1F497D"><span
              style="mso-list:Ignore">·<span style="font:7.0pt
                &quot;Times New Roman&quot;">        
              </span></span></span><!--[endif]--><span
            style="color:#1F497D">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?<o:p></o:p></span></p>
        <p class="MsoListParagraph"
          style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
            style="font-family:Symbol;color:#1F497D"><span
              style="mso-list:Ignore">·<span style="font:7.0pt
                &quot;Times New Roman&quot;">        
              </span></span></span><!--[endif]--><span
            style="color:#1F497D">What is the use of read_fds[] in
            rest_methods.c and who uses it?
            <o:p></o:p></span></p>
        <p class="MsoListParagraph"
          style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
            style="font-family:Symbol;color:#1F497D"><span
              style="mso-list:Ignore">·<span style="font:7.0pt
                &quot;Times New Roman&quot;">        
              </span></span></span><!--[endif]--><span
            style="color:#1F497D">Why select() is not used ?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Agalya<o:p></o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
                style="color:windowtext"> Liviu Chircu
                [<a class="moz-txt-link-freetext" href="mailto:liviu@opensips.org">mailto:liviu@opensips.org</a>]
                <br>
                <b>Sent:</b> Monday, October 31, 2016 12:27 PM<br>
                <b>To:</b> Ramachandran, Agalya (Contractor)
                <a class="moz-txt-link-rfc2396E" href="mailto:Agalya_Ramachandran@comcast.com">&lt;Agalya_Ramachandran@comcast.com&gt;</a>; OpenSIPS users
                mailling list <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org">&lt;users@lists.opensips.org&gt;</a><br>
                <b>Subject:</b> Re: Support for https in async<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p><tt><span style="font-size:10.0pt">Hi, Agalya!</span></tt><span
            style="font-size:12.0pt"><o:p></o:p></span></p>
        <p><tt><span style="font-size:10.0pt">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]</span></tt><o:p></o:p></p>
        <p><tt><span style="font-size:10.0pt">[1]: <a
                moz-do-not-send="true"
                href="https://curl.haxx.se/libcurl/c/https.html">
                https://curl.haxx.se/libcurl/c/https.html</a></span></tt><o:p></o:p></p>
        <pre>Liviu Chircu<o:p></o:p></pre>
        <pre>OpenSIPS Developer<o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre>
        <div>
          <p class="MsoNormal">On 31.10.2016 16:41, Ramachandran, Agalya
            (Contractor) wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:blue">Hi team, </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">Have you tried
              with </span><b><span style="color:red"><a
                  moz-do-not-send="true" href="https://url"><span
                    style="color:red">https://url</span></a></span></b><span
              style="color:red">
            </span><span style="color:blue">with async and does that
              work without issue ?</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">When I try,
              resume_async_http_req is called, but crash is occurring at
              libcurl library. So helpless to debug further.
            </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">async(rest_put</span><span
              style="color:red">(<b><a moz-do-not-send="true"
                  href="https://url">"https://url"</a>,
              </b></span><span style="color:blue">"$fU,$tU,$ci ",
              "application/json", "$var(body)", "$var(ct)",
              "$var(rcode)"),resume);</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">My question is
              crash occring only in my scenario or  OpenSIPS doesn’t
              support async as https?
            </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">Here is my dump
              just in case for reference.
            </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
          <p class="MsoNormal"><i><span style="color:#A50021">#0 
                0x00007f567248da1e in Curl_raw_nequal () from
                /lib64/libcurl.so.4</span></i><o:p></o:p></p>
          <p class="MsoNormal"><i><span style="color:#A50021">#1 
                0x00007f567245bd0f in Curl_checkheaders () from
                /lib64/libcurl.so.4</span></i><o:p></o:p></p>
          <p class="MsoNormal"><i><span style="color:#A50021">#2 
                0x00007f567245d1e5 in Curl_http () from
                /lib64/libcurl.so.4</span></i><o:p></o:p></p>
          <p class="MsoNormal"><i><span style="color:#A50021">#3 
                0x00007f567246db4b in Curl_do () from
                /lib64/libcurl.so.4</span></i><o:p></o:p></p>
          <p class="MsoNormal"><i><span style="color:#A50021">#4 
                0x00007f567247da1b in multi_runsingle () from
                /lib64/libcurl.so.4</span></i><o:p></o:p></p>
          <p class="MsoNormal"><i><span style="color:#A50021">#5 
                0x00007f567247e121 in curl_multi_perform () from
                /lib64/libcurl.so.4</span></i><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">#6 
              0x00007f56726b75ca in resume_async_http_req (fd=9,
              msg=0x7f56739c0640 &lt;faked_req.10404&gt;,
              _param=0x7f56b3e354d0)</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">    at
              rest_methods.c:380</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">#7 
              0x00007f56737771ff in t_resume_async (fd=0x7f56b3e26840,
              param=0x7f567405c3e8) at async.c:125</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">#8 
              0x0000000000509975 in handle_io (fm=0x7f56b3e26840, idx=1,
              event_type=1) at net/net_udp.c:267</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">#9 
              0x00000000005082b3 in io_wait_loop_epoll (h=0x806e00
              &lt;_worker_io&gt;, t=1, repeat=0) at
              net/../io_wait_loop.h:221</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">#10
              0x0000000000509c30 in udp_rcv_loop (si=0x7f56b3dd6808) at
              net/net_udp.c:308</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">#11
              0x000000000050a1c8 in udp_start_processes
              (chd_rank=0x7d30e8 &lt;chd_rank.10706&gt;,
              startup_done=0x0) at net/net_udp.c:372</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">#12
              0x0000000000492304 in main_loop () at main.c:671</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">#13
              0x0000000000494d8f in main (argc=7, argv=0x7fff38a979f8)
              at main.c:1261</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">Regards,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">Agalya</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0in 0in 0in">
              <p class="MsoNormal"><b>From:</b> Ramachandran, Agalya
                (Contractor) <br>
                <b>Sent:</b> Thursday, October 27, 2016 4:24 PM<br>
                <b>To:</b> <a moz-do-not-send="true"
                  href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>;
                'Liviu Chircu'
                <a moz-do-not-send="true"
                  href="mailto:liviu@opensips.org">&lt;liviu@opensips.org&gt;</a><br>
                <b>Subject:</b> Support for https in async<o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">Hi team,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">Just a quick
              question.. Does async(), method supports https request?</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">When I try to
              use https, resume_async_http_req is called, but I never
              got the response and rather OpenSIPS crashed at libcurl.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:blue">Regards,<br>
              Agalya</span><o:p></o:p></p>
        </blockquote>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:&quot;Times New
            Roman&quot;,serif"><o:p> </o:p></span></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>