<div dir="ltr">Hi Matt,<div><br></div><div>this make sense. As if I disable TLS1.3, the issue is gone. Thanks for your help.</div><div><br></div><div>Regards,</div><div>Dave</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 11, 2018 at 2:36 AM Matt Caswell <<a href="mailto:matt@openssl.org">matt@openssl.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I opened this issue to track this problem:<br>
<br>
<a href="https://github.com/openssl/openssl/issues/7384" rel="noreferrer" target="_blank">https://github.com/openssl/openssl/issues/7384</a><br>
<br>
Matt<br>
<br>
<br>
On 11/10/18 10:25, Matt Caswell wrote:<br>
> <br>
> <br>
> On 10/10/18 23:04, Dave Wang wrote:<br>
>> Hi there,<br>
>><br>
>> I have a client can talk with server, where the client certificate is<br>
>> loaded in client_cert_cb  based on matching the server side certificate.<br>
>><br>
>> it works perfectly in openssl 1.1.0h, however it stops working after I<br>
>> upgrade to openssl 1.1.1.<br>
>><br>
>> In client_cert_cb , when I call SSL_get_peer_certificate, it returns<br>
>> NULL, which is different from openssl 1.1.0h.<br>
>><br>
>> I do set SSL_VERIFY_PEER on both sides. <br>
>><br>
>><br>
>> any thoughts on this?<br>
> <br>
> I assume this only happens with a TLSv1.3 handshake?<br>
> <br>
> From the documentation, the client_cert_cb is called: "when a client<br>
> certificate is requested by a server". In practice this means when we<br>
> have received the CertificateRequest message from the server.<br>
> <br>
> In TLSv1.2 (and below) the server's first flight of messages for a<br>
> client-auth full handshake in response to a ClientHello looks like this:<br>
> <br>
> ServerHello<br>
> Certificate<br>
> ServerKeyExchange<br>
> CertificateRequest<br>
> ServerHelloDone<br>
> <br>
> In TLSv1.3 it looks like this:<br>
> <br>
> ServerHello<br>
> EncryptedExtensions<br>
> CertificateRequest<br>
> Certificate<br>
> CertificateVerify<br>
> Finished<br>
> <br>
> Note that in TLSv1.2 the CertificateRequest message comes *after* the<br>
> server has sent the Certificate but in TLSv1.3 it comes *before*. That<br>
> means of course that in TLSv1.3 the client_cert_cb gets called before we<br>
> have processed the server's certificate and hence<br>
> SSL_get_peer_certificate() returns NULL.<br>
> <br>
> I'm wondering whether we should delay calling the client_cert_cb in<br>
> TLSv1.3 until after the CertificateVerify has been processed.<br>
> <br>
> Matt<br>
> <br>
-- <br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</blockquote></div>