Add better error message when certificate chain verification fails

v2.0 version of the patch already committed to master.  The patch is actually identical.