<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 28, 2017 at 9:11 PM, Viktor Dukhovni <span dir="ltr"><<a href="mailto:openssl-users@dukhovni.org" target="_blank">openssl-users@dukhovni.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Tue, Nov 28, 2017 at 10:03:12AM +0000, <a href="mailto:wizard2010@gmail.com">wizard2010@gmail.com</a> wrote:<br>
<br>
> I guess my problem is really related to verify callback<br>
> on SSL_CTX_set_verify function.<br>
> I just add to my code a dummy callback returning 1 and everything works<br>
> properly.<br>
><br>
><br>
> > int verify_callback (int ok, X509_STORE_CTX *ctx);<br>
> > int verify_callback (int ok, X509_STORE_CTX *ctx)<br>
> > {<br>
> >     printf("Verification callback OK!\n");<br>
> >     return 1;<br>
> > }<br>
> > ...<br>
> > SSL_CTX_set_verify(ssl_server_<wbr>ctx, SSL_VERIFY_PEER |<br>
> > SSL_VERIFY_FAIL_IF_NO_PEER_<wbr>CERT, dtls_verify_callback);<br>
<br>
</span>The above completely disables authentication of the peer certificate,<br>
and makes your application vulnerable to man-in-the-middle attacks.<br>
Perhaps that's OK, but often it is not.<br></blockquote><div><br></div><div>Why did you say that code disable the authentication? </div><div>One thing that I didn't understand is what type of verification is made on SSL_CTX_set_verify function. </div><div>And what is supposed/right thing to do on  verify_callback in order to perform the client certificate authentication?</div><div> </div><div>Kind regards.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> The problem is that error don't tell much information about what's really<br>
> going on or what's really missing.<br>
<br>
</span>When the verification callback is failing, the peer's certificate<br>
chain is either incomplete or is using a trust-anchor (root CA)<br>
that is not configured as trusted on your end.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
--<br>
        Viktor.<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/<wbr>mailman/listinfo/openssl-users</a><br>
</font></span></blockquote></div><br></div></div>