<div dir="ltr"><div><div><div><div><div>So I made a bit more research on this issue. The certificate seems to be loaded and sent to the server.<br></div>But then the server fails to verify that certificate since it does not have the ca-list that was loaded for the client.<br></div>The error that I get server side is X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY.<br></div>Any idea how to deal with this issue?<br><br></div>Should I try to skip this kind of verification server side?<br><br></div>Regards<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 24, 2015 at 2:41 PM, Ignacio Casal <span dir="ltr"><<a href="mailto:ignacio.casal@nice-software.com" target="_blank">ignacio.casal@nice-software.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hey guys,<br><br></div>I am currently working on an openssl backend for glib and I got to a point where I am blocked and maybe you can help me understand what I am doing wrong.<br><br></div>First of all the source code can be found here: <a href="https://github.com/nice-software/glib-networking/tree/wip/openssl" target="_blank">https://github.com/nice-software/glib-networking/tree/wip/openssl</a><br><br></div>The problem is the next, on one of our unit tests we require a specific authentication, meaning that I endup calling SSL_set_verify, as you can see here: <a href="https://github.com/nice-software/glib-networking/blob/wip/openssl/tls/openssl/gtlsserverconnection-openssl.c#L127" target="_blank">https://github.com/nice-software/glib-networking/blob/wip/openssl/tls/openssl/gtlsserverconnection-openssl.c#L127</a><br><br></div>This should make the server require the client to send the certificate but for some reason this certificate is never sent and I endup having an error when handshaking.<br><br></div>I was reading that I can just simply set the certificate callback as I do here: <a href="https://github.com/nice-software/glib-networking/blob/wip/openssl/tls/openssl/gtlsclientconnection-openssl.c#L437" target="_blank">https://github.com/nice-software/glib-networking/blob/wip/openssl/tls/openssl/gtlsclientconnection-openssl.c#L437</a><br><br></div><div>This callback gets called and I set the certificate but adding some debugging on openssl's code I see I keep getting that the server does not get the certificate.<br><br></div><div>Here is a extract of the printfs I added to the openssl code. Any ideas?<br></div><div><br>server, accept<br>server, get client hello: 1<br>server, send server hello: 1<br>server, send server cert: 1<br>server, send cert request: 1<br>connect1<br>get server hello: 1<br>get key exchange: 1<br>get cert request: 1<br>get server done: 1<br>do client cert cb: 1<br>do client cert cb2: 1<br>do client cert cb4: 1<br>do client cert cb do write<br>send client cert: 1<br>send client key exchange: 1<br>send client verify: 1<br>change cipher spec: 1<br>send finished: 1<br>server, check client hello: 1<br>server, get client cert: -1<br>server, accept2: -1<br>finish not ok<br>get finsihed: 0<br>connect2: 0<br><br><br></div><div>Cheers.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div><div><div><div><div><div><div><div><br>-- <br><div><div dir="ltr"><div>Ignacio Casal Quinteiro<br></div></div></div>
</div></div></div></div></div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Ignacio Casal Quinteiro<br></div></div></div>
</div>