跳轉至內容

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);
華夏公益教科書