<p></p>
<p>OK, this turns out to be a lot more complicated. I'll try to describe as accurately as possible.</p>
<p>Turns out SSL support was already disabled on the server-side, so in all above examples there was no SSL used for the database connection. Although that doesn't rule out libssl still being involved in the db code, to <em>try</em> to negotiate a SSL connection.</p>
<p>I was able to upgrade to Kamailio 5.3 without any problems, with exactly the same behavior as before; able to reproduce both failure modes.</p>
<p>With <code>modparam("db_mysql", "opt_ssl_mode", 1)</code> I can still easily reproduce failure mode 1.</p>
<p>I'm struggling to generate "accurate" backtraces for that, because either I'm crazy, or Kamailio keeps on "fixing itself" at <em>exactly</em> the moment I decide to run <code>pstrap</code>. It can be frozen for minutes, not responding to any TCP socket at all, then suddenly in the middle of the gdb process print a bunch of messages like "tcpconn_1st_send(): connect 157.245.69.206:40573 failed (RST) Connection refused" then continue to function again.</p>
<p>Nonetheless, even with <code>modparam("db_mysql", "opt_ssl_mode", 1)</code> I see libmysqlclient in the backtrace coming from various ssl functions, e.g.</p>
<pre><code>#3  0x00007fe9a9c87d30 in ?? () from /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20
#4  0x00007fe9a9275c63 in ssleay_rand_add (buf=0x7ffcf0a04b18, num=8, add=0) at md_rand.c:230
</code></pre>
<p>Finally, so far I'm completely unable to reproduce the issue when <code>db_mysql.so</code> is not loaded! Looks like having both db_mysql.so and tls.so loaded causes some kind of conflict..</p>
<p>That's a lot of input - does this help and/or is there any avenue you'd like me to debug further?</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/2395#issuecomment-656150321">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZK5ATZDVJ6TQARYO6TR2XFTXANCNFSM4OS7FHTQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZNTXCZP7EM4PUBVOGLR2XFTXA5CNFSM4OS7FHT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE4OA6MI.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/2395#issuecomment-656150321",
"url": "https://github.com/kamailio/kamailio/issues/2395#issuecomment-656150321",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>