Hi all,<div><br>I need an advice from some SSL guru here. I want to implement SSL mutual authentication. I'm using R14B02. During certificate validation I want also to obtain Common Name value. To do this I try to use verify_fun option but with no luck.<div>

<br>Documentation states:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

The verify fun will be called during the X509-path validation when an error or an extension unknown to the ssl application is encountered. Additionally it will be called when a certificate is considered valid by the path validation to allow access to each certificate in the path to the user application.</blockquote>

<br>My SSL Options tuple looks like this:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

                    {ssl_opts, [{certfile, filename:join([code:priv_dir(ws), "ssl", "server.crt"])},<br>                                  {keyfile, filename:join([code:priv_dir(ws), "ssl", "server.key"])},<br>

                                  {verify, verify_peer},<br>                                  {cacertfile, filename:join([code:priv_dir(ws), "ssl", "ca.crt"])},<br>                                  {fail_if_no_peer_cert, true}, <br>

                                  {verify_fun, {fun validate/3, []}} </blockquote><br>I expect that my validate fun will be invoked after successfull SSL handshake, but it's not.<div><br>After some digging I discovered that ssl_handshake:certify/6 function has been changed in this commit: <a href="https://github.com/erlang/otp/commit/4dbf3c9e4ae7cfd19b247353369166d31b8f15e5#diff-0">https://github.com/erlang/otp/commit/4dbf3c9e4ae7cfd19b247353369166d31b8f15e5#diff-0</a></div>

<div><br>It basically wraps my verify_fun in it's own, and passes this further to pubkey_cert:verify_fun/4, and it never invokes my verify_fun, due to the change introduced by the commit mentioned above (when you have valid vertificate, your verify_fun is never called, which is in opposite to the documentation).</div>

<div><br>Is current behaviour intentional or a bug? Or maybe I'm doing something wrong along the way?</div><div><br>Kind regards,<br>Konrad</div></div></div>