Concerns the following code: https://github.com/kamailio/kamailio/blob/master/src/modules/tls/tls_domain....
Let's say `sname = sip.example.com` and `p->server_name = example.com`.
``` 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] == '.')
```
`sip.example.com"[4]` is "e", not "." so the if clause will always fail and subdomains will never be matched.
Thanks @laszlovl for report and pointers to the issue. I pushed a fix to master (commit references above) and I will backport soon.
Closed #2049.