<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>looks like a bug in that matching conditions. I guess I used with
      same value for server id and server name, so the issue was not
      exposed. I will fix it soon.<br>
    </p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 21.01.20 13:54, mahesh b wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CACYt9VjoadQnnjJBM_yS8dj8WOVO-ov66CFrj52Rf77VMQiHHw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi All,
        <div><br>
        </div>
        <div>Am using kamailio 5.1.9 version</div>
        <div><br>
        </div>
        <div>From <a
            href="http://www.kamailio.org/docs/modules/5.1.x/modules/tls.html"
            moz-do-not-send="true">http://www.kamailio.org/docs/modules/5.1.x/modules/tls.html</a> ,
          i understand " <span
style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px;text-align:justify">The
            value for server_id can be any string, being used to match
            TLS client config profile, overriding the match on ip:port
            and server_name.</span> " </div>
        <div><br>
        </div>
        <div>Which suggests that the server_name and server_id can be
          different for a tls profile <br>
        </div>
        <div><br>
        </div>
        <div>
          <table class="gmail-highlight gmail-tab-size
            gmail-js-file-line-container"
style="box-sizing:border-box;border-spacing:0px;border-collapse:collapse;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">
            <tbody style="box-sizing:border-box">
              <tr style="box-sizing:border-box">
                <td id="gmail-LC1369" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre">
IN my tls.cfg i have
[client:default]
verify_certificate = no
require_certificate = no

[client:<a href="http://10.211.160.172:5071" moz-do-not-send="true">10.211.160.172:5071</a>]
method = TLSv1.2
verify_certificate = yes
require_certificate = yes
private_key = /ssl/sip/profile1/server.key
certificate = /ssl/sip/profile1/server.crt
ca_list = /ssl/sip/profile1/ca.crt
cipher_list = RSA
verify_depth = 9
server_id = profile1
server_name = <a href="http://btip.176.com" moz-do-not-send="true">btip.176.com</a>

And in sar.cfg i am doing, before sending the request out

$xavp(tls=>server_name)="<a href="http://btip.176.com" moz-do-not-send="true">btip.176.com</a>";
$xavp(tls[0]=>server_id)="profile1";

But if i see the logs , its picking client default profile for tls handshake, Am i missing anything in tls.cfg or sar.cfg ?

<div>if i see the code in <span style="color:rgb(111,66,193)">tls_lookup_cfg() </span></div><div><span style="color:rgb(111,66,193)">
</span></div><div><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container" style="box-sizing:border-box;border-spacing:0px;border-collapse:collapse;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td id="gmail-LC1359" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px"><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">while</span> (p) {</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1360" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1360" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">               <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">if</span>(srvid && srvid-><span class="gmail-pl-smi" style="box-sizing:border-box">len</span>><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">0</span>) {</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1361" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1361" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                       <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">LM_DBG</span>(<span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span>comparing addr: [<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%s</span>:<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%d</span>]  [<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%s</span>:<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%d</span>] -- id: [<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%.*s</span>] [<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%.*s</span>]<span class="gmail-pl-cce" style="box-sizing:border-box">\n</span><span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span>,</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1362" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1362" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                               <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">ip_addr2a</span>(&p-><span class="gmail-pl-smi" style="box-sizing:border-box">ip</span>), p-><span class="gmail-pl-smi" style="box-sizing:border-box">port</span>, <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">ip_addr2a</span>(ip), port,</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1363" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1363" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                               p-><span class="gmail-pl-smi" style="box-sizing:border-box">server_id</span>.<span class="gmail-pl-smi" style="box-sizing:border-box">len</span>, <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">ZSW</span>(p-><span class="gmail-pl-smi" style="box-sizing:border-box">server_id</span>.<span class="gmail-pl-smi" style="box-sizing:border-box">s</span>),</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1364" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1364" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                               srvid-><span class="gmail-pl-smi" style="box-sizing:border-box">len</span>, <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">ZSW</span>(srvid-><span class="gmail-pl-smi" style="box-sizing:border-box">s</span>));</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1365" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1365" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                       <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">if</span>(p-><span class="gmail-pl-smi" style="box-sizing:border-box">server_id</span>.<span class="gmail-pl-smi" style="box-sizing:border-box">s</span> && p-><span class="gmail-pl-smi" style="box-sizing:border-box">server_id</span>.<span class="gmail-pl-smi" style="box-sizing:border-box">len</span>==srvid-><span class="gmail-pl-smi" style="box-sizing:border-box">len</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L1366" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1366" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                                       && <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">strncasecmp</span>(p-><span class="gmail-pl-smi" style="box-sizing:border-box">server_name</span>.<span class="gmail-pl-smi" style="box-sizing:border-box">s</span>, srvid-><span class="gmail-pl-smi" style="box-sizing:border-box">s</span>, srvid-><span class="gmail-pl-smi" style="box-sizing:border-box">len</span>)==<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">0</span>) {</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1367" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1367" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                               <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">LM_DBG</span>(<span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span>TLS config found by server id<span class="gmail-pl-cce" style="box-sizing:border-box">\n</span><span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span>);</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1368" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1368" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                               <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">return</span> p;</td></tr><tr style="box-sizing:border-box"><td id="gmail-L1369" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top">
</td><td id="gmail-LC1369" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px">                       }
....

Why is that there is a strncasecmp between p->server_name.s and srvid->s ?? the strncasecmp should be between p->server_id.s and srvid->s right ?</td></tr></tbody></table></div>
Regards,
Mahesh.B</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - March 9-11, 2020, Berlin - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - April 27-29, 2020, in Berlin -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>