[SR-Users] Re-using an existing TLS connection

Matthias Urlichs matthias at urlichs.de
Fri Feb 25 11:54:51 CET 2022


Hi,
> for a start - did you already tried this parameter:http://www.kamailio.org/wiki/cookbooks/5.5.x/core#tcp_reuse_port
>
> Then have a look for example to this discussion:https://lists.kamailio.org/pipermail/sr-users/2019-November/107222.html

Thanks for the pointers. Got it to work.


For the record, what I did:

* add "name sock_tls" to the listen= parameter

* set tcp_reuse_port=yes

* the handler for OPTIONS saves the remote port to $shv(port__XXX)

* my call handler sets $fsn="sock_tls" and $rp to $shv(port__XXX)

… and that's it. So that was easier than expected.


NB, when browsing the sources for this I noticed that the 
"tcp_reuse_port" option is not recognized at all if the OS does not 
support SO_REUSEPORT.

However, here we're re-using an existing connection instead of opening a 
new connection from a port that has existing connections. Thus on 
systems that don't have SO_REUSEPORT (some BSDs, AFAIK) this method 
doesn't work (but should).

This mismatch is also the reason why I didn't notice this option in the 
documentation …

-- 
-- Matthias Urlichs

-------------- next part --------------
A non-text attachment was scrubbed...
Name: matthias.vcf
Type: text/x-vcard
Size: 4 bytes
Desc: not available
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220225/7633166d/attachment.vcf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220225/7633166d/attachment.sig>


More information about the sr-users mailing list