跳转至内容

OpenSSL/验证回调

来自维基百科,一个开放世界的开放书籍
/* This is helpful for debugging the unhelpful error
 * "unable to get local issuer certificate", which could mean
 * almost anything.  But, unfortunately, this is a little too
 * verbose for normal use. */
X509_VERIFY_PARAM *vp = X509_VERIFY_PARAM_new ();
if (1 != X509_VERIFY_PARAM_set_flags (vp, X509_V_FLAG_CB_ISSUER_CHECK))
  error ();
if (1 != SSL_CTX_set1_param (context, vp))
  error ();
X509_VERIFY_PARAM_free (vp);
华夏公益教科书