<p></p>
<h3>Description</h3>
<p>I am connecting two kamailio (5.4.5) using TLS with client cert verification. When one side is OpenSSL 1.1.1 (CentOS 8) + P-256 cert and the other side is OpenSSL 1.0.2 (CentOS 7) + P-521 cert <em>and</em> <code>cipher_list</code> is set(e.g., <code>DEFAULT</code>), the ClientHello fails because the only supported curve sent is P-256 (server has P-521).</p>
<h3>Troubleshooting</h3>
<ol>
<li>If <code>cipher_list</code> is <em>not</em> set at all in <code>[client:defaut]</code>l, then the ClientHello sends 4 supported EC groups and the handshake succeeds.<br>
2 . If <code>cipher_list</code> is set in <code>[client:defaut]</code> (e.g. <code>DEFAULT</code> or <code>ANY</code>) then the ClientHello sends only 1  supported EC group P-256 (I guess because the client is using a P-256 cert), then the handshake will fail.</li>
</ol>
<h4>Reproduction</h4>
<ol>
<li>Connect two kamailos one on CentOS 8 sending SIP to one on CentOS 7, enable TLS, with client cert verification. Put a P-256 cert on CentOS 8 and a P-521 cert on CentOS 7.</li>
</ol>
<h4>Debugging Data</h4>
<ol>
<li><code>cipher_list</code> is not set: TLS ClientHello Supported Groups is  4 groups: secp256r1 secp521r1 secp384r1 secp256k1</li>
<li><code>cipher_list</code> is set to <code>DEFAULT</code>: TLS ClientHello Supported Groups is  1 group: secp256r1.</li>
</ol>
<h4>Log Messages</h4>
<pre><code>ERROR: tls [tls_util.h:42]: tls_err_ret(): TLS accept:error:1408A0C1:SSL routines:ssl3_get_client_hello:no shared cipher
</code></pre>
<h4>SIP Traffic</h4>
<p>NA - couldn't complete TLS handshake so no SIP was transferred.</p>
<h3>Possible Solutions</h3>
<ol>
<li>Don't set cipher_list at all; the moment you set cipher_list to anything(<code>ANY</code>, <code>DEFAULT</code> etc), the ClientHello will narrow the supported groups to P-256 and the server will reject.</li>
</ol>
<p>I have a thought: does <code>setup_ecdh()</code> in <code>tls_domain.c</code> behave differently on OpenSSL 1.1.1? Maybe it is forcing the handshake to send only the curve of the client.</p>
<h3>Additional Information</h3>
<ol>
<li>kamailio version is 5.4.5</li>
<li>Must be OpenSSL 1.1.1 to OpenSSL 1.0.2. BTW in the reverse direction P-521 CentOS 7 to P-256 CentOS 8 doesn't encounter this issue.</li>
</ol>

<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/2716">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZJI2J2FFIDIH4SZA33TK3LAJANCNFSM43VHZBEA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZMELOFLG35APHJWPALTK3LAJA5CNFSM43VHZBEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4M6LWDQQ.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/2716",
"url": "https://github.com/kamailio/kamailio/issues/2716",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>