<p></p>
<p dir="auto">We use Kamilio as a proxy server to connect softphones to our PBX systems.<br>
We have run into some TLS problems. These problems result in a shut down of the TLS connection after the error is encountered.</p>
<p dir="auto">We have looked into serial numbers of certificates. The current code in kamailio seems to be broken due to changes in the world around... many certificates today do not adhere to the previously assumed behaviour of certificate serial numbers anymore.<br>
The error which causes the connection to drop seems to be related to a comparison of the certificate serial numbers during renegotiation.<br>
tls_err_ret(): TLS read:error:0D0E10DF:asn1 encoding routines:asn1_get_uint64:too large<br>
Kamailio expects serial numbers to fit in a 64 bit unsigned, however during the last years, starting around 2003 more and more systems use automatically generated serial numbers, which are frequently 128 bit long.<br>
The serialnumber of our own Auerswald root certificate looks to be only 64 bit long, but during the negotiation is presented as 9 bytes starting with 00h, which is interpreted as a 72bit value. Trying to put this serial number in a 64 bit long kills the connection.<br>
Due to the different ways that are used to generate serial numbers now, there is no simple algorithm to condense the number into a 64bit value, and the whole number should be compared to see if it is same or higher.<br>
We currently have disabled renegotiation to avoid the connection being dropped during renegotiation. Which however can lead to the connection being dropped by the other side during renegotiation, but this is not a good permanent workaround!</p>
<h4 dir="auto">Reproduction</h4>
<p dir="auto">This issue happens infrequently</p>
<h3 dir="auto">Possible Solutions</h3>
<p dir="auto">No workaround possible on our side</p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">Kamailio Version 5.5.4<br>
LibSSL 1.1.1.n</p>
<ul dir="auto">
<li><strong>Operating System</strong>:<br>
Linux, Debian oldstable</li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3168">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMJIVNVFAEFD42CXULVRPTVHANCNFSM52EQU2XA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZPBD4PND4LOG6QHRKTVRPTVHA5CNFSM52EQU2XKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4TGIZ4AQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3168</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3168",
"url": "https://github.com/kamailio/kamailio/issues/3168",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>