<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">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">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">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.<br></div><div><br></div><div><div><div><div><div><div><div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Ignacio Casal Quinteiro<br></div></div></div>
</div></div></div></div></div></div></div></div></div>