it makes an immediate connection to the broker on startup
Can you run kamailio under gdb with tls_thread_mode=1 with the following script You will need to start kamailio first as thread 1 is not started yet something like
gdb --args /usr/local/sbin/kamailo ................ break main r
then use the following script:
break CRYPTO_THREAD_set_local thread 1 commands bt 16 cont end
...then continue