<div dir="ltr"><div>Hi!<br></div><div><br></div><div>First of all, thank you Dmitry and Ingela for the quick replies.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="gmail-"><div>Yes it disables all hostname checks making you vulnerable to the things they where designed to protect.</div></span></div></blockquote><div><br></div><div>Thought so, so I would prefer not to use the disable option.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="gmail-"><div>The way to customize the checks is to handle them in your own verify_fun, why do you think that is convulted?</div></span></div></blockquote><div><br></div><div>It just seemed weird to me to write erlang functions inside a configuration file. But then again, I didn't understand it could be just a short function, which makes it a lot more acceptable.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>The verify_fun can be very simple only specifically handling the <span style="font-size:12.8px"> </span><span style="font-size:12.8px">{bad_cert, hostname_check_failed} then all other checks will behave as before. The verify_fun is not meant to  replace the default certiface checks it </span></div><div><span style="font-size:12.8px">is for extending the checks </span><span style="font-size:12.8px">and possible ignoring some specific error (even though this is seldom desirable). </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Something like:</span></div><div><span style="font-size:12.8px"><br></span></div><div><pre style="font-family:mono,Courier,monospace;margin-top:0px;margin-bottom:0px;color:rgb(56,58,66);font-size:11.2px">{fun(_,{bad_cert, hostname_check_failed}, _) ->
         %%% Preform own check ...
    (_,{extension, _}, UserState) ->
         {unknown, UserState};
    (_, valid, UserState) ->
         {valid, UserState};
    (_, valid_peer, UserState) ->
         {valid, UserState}
 end, []}</pre></div></div></div></div></blockquote><div><br></div><div>I tried this, but the weird thing is that when I explicitly set verify_fun to what is described as the default in the documentation:</div><div><br></div><div><pre>{fun(_,{bad_cert, _} = Reason, _) ->
         {fail, Reason};
    (_,{extension, _}, UserState) ->
         {unknown, UserState};
    (_, valid, UserState) ->
         {valid, UserState};
    (_, valid_peer, UserState) ->
         {valid, UserState}
 end, []}<br><br></pre><pre><font face="arial,helvetica,sans-serif">I do not get the hostname_check_failed error anymore. I did not expect this.<br><br></font></pre><pre><font face="arial,helvetica,sans-serif">I believe `ssl_certificate:verify_hostname` is called when I do not explicitly provide verify_fun, because I added some debug statements that got executed.<br></font></pre><pre><font face="arial,helvetica,sans-serif">When I do provide the verify_fun as above the debug statements no longer get executed. But I couldn't find any other occurrences of hostname_check_failed in my copy of the `lib` dir of erlang 20.2. <br></font></pre></div></div><br></div></div>