<p>Concerns the following code: <a href="https://github.com/kamailio/kamailio/blob/master/src/modules/tls/tls_domain.c#L1567">https://github.com/kamailio/kamailio/blob/master/src/modules/tls/tls_domain.c#L1567</a></p>
<p>Let's say <code>sname = sip.example.com</code> and <code>p->server_name = example.com</code>.</p>
<pre><code>dotpos = sname->len - p->server_name.len;
> dotpos = len("sip.example.com") - len("example.com")
> dotpos = 15 - 11 = 4
if (sname->s[dotpos] == '.')
> if ("sip.example.com"[4] == '.')
</code></pre>
<p><code>sip.example.com"[4]</code> is "e", not "." so the if clause will always fail and subdomains will never be matched.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2049?email_source=notifications&email_token=ABO7UZOMCDSJKG5WPG7NJYDQGZMMJA5CNFSM4IRDF642YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HH4RYHA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOKD32EUU4XR7C57ETQGZMMJANCNFSM4IRDF64Q">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZMAMLVWBXYLMNMOBZ3QGZMMJA5CNFSM4IRDF642YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HH4RYHA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2049?email_source=notifications\u0026email_token=ABO7UZOMCDSJKG5WPG7NJYDQGZMMJA5CNFSM4IRDF642YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HH4RYHA",
"url": "https://github.com/kamailio/kamailio/issues/2049?email_source=notifications\u0026email_token=ABO7UZOMCDSJKG5WPG7NJYDQGZMMJA5CNFSM4IRDF642YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HH4RYHA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>