static unsigned x509_end_chain(const br_x509_class **ctx)
{
  struct x509_context *x509 = (struct x509_context *)ctx;
  unsigned err;

  err = x509->minimal.vtable->end_chain(&x509->minimal.vtable);
  if(err && !x509->verifypeer) {
    /* ignore any X.509 errors */
    err = BR_ERR_OK;
  }

  return err;
}
static unsigned x509_end_chain(const br_x509_class **ctx)
{
  struct x509_context *x509 = (struct x509_context *)ctx;
  unsigned err;

  err = x509->minimal.vtable->end_chain(&x509->minimal.vtable);
  if(err && !x509->verifypeer) {
     
    err = BR_ERR_OK;
  }

  return err;
}