<div dir="ltr">On Thu, Sep 10, 2015 at 12:44 PM Ben Murphy <<a href="mailto:benmmurphy@gmail.com">benmmurphy@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a verify function that hacks around this problem. It adds the<br>
certs to a list during the 'verification' then it resorts and passes<br>
it off to the path validation. However, this function only supports<br>
validation from a single root cert because we are using it in<br>
production to connect to a server that has a chain signed by a<br>
non-public CA. You use it like: {verify_fun,<br>
fixed_root_lenient_verifier:create_verify_function(DerCaCert, 10)}<br>
<br>
Use this module at your own risk it may effectively disable your SSL<br>
security. I really think this resorting should be done in OTP or OTP<br>
should supply a cleaner hook for resorting. A hook that gives you the<br>
chain and the cacerts and lets you send back a new chain would be<br>
perfect :)<br></blockquote><div><br></div><div><br></div><div>ThanksBen! At least your code gave me some hints. I came to a simpler solution for now:</div><div><br></div><div><a href="https://github.com/benoitc/hackney/pull/241">https://github.com/benoitc/hackney/pull/241</a><br></div><div><br></div><div>Though I am not really sure it's correct. The only thing it does is to skip the self signed certificate and try to find a good one. Any feedback is appreciated.</div><div><br></div><div>What would be the best way to reorder the certificate chain?</div><div><br></div><div>- benoit</div></div></div>