<div dir="ltr">Hi Zbyszek,<div><br></div><div>Thanks for your reply. I look forward to the official documentation.</div><div><br></div><div>The callback function returns true when preverified == false. Not sure why it should always return true, which accepts any client certificate.</div><div><br></div><div><div style="line-height:18px"><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(106,153,85)">            // We always return true to allow full auth flow</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(106,153,85)">            if (!preverified)</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(106,153,85)">            {</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(106,153,85)">                BMCWEB_LOG_DEBUG << this << " TLS preverification failed.";</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(106,153,85)">                return true;</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(106,153,85)">            }</span></div><br>Thanks,<br>Zhenfei</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 6, 2020 at 4:22 AM Zbyszek <<a href="mailto:zbigniewku@gmail.com">zbigniewku@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">pt., 1 maj 2020 o 02:07 Zhenfei Tai <<a href="mailto:ztai@google.com" target="_blank">ztai@google.com</a>> napisaƂ(a):<br>
><br>
> Hi,<br>
><br>
> I've been testing bmcweb mTLS for a while and found the user defined verify callback function returns true in all cases. (<a href="https://github.com/openbmc/bmcweb/blob/master/http/http_connection.h#L287" rel="noreferrer" target="_blank">https://github.com/openbmc/bmcweb/blob/master/http/http_connection.h#L287</a>)<br>
><br>
> If client authentication is enabled in bmcweb, should it reject if client certificate is bad?<br>
<br>
No, purpose of this callback is to only extract the user name from the<br>
certificate and then allow to proceed with default OpenSSL<br>
verification flow which should finally fail if something is wrong with<br>
the certificate no matter what this function returned.<br>
The 'set_verify_callback' doesn't replace the whole verification<br>
procedure, it only adds a callback that is called when the default<br>
validator checks each certificate. The 'preverified' parameter, passed<br>
to it indicates if verification of the certificate succeeded or not.<br>
You should be able to see it in bmcweb logs.<br>
<br>
><br>
> Thanks,<br>
> Zhenfei<br>
</blockquote></div>