find_chain = issuer->chain;
}
+ if (!find_chain) {
+ /* always put a null chain stack in the SSL_CTX so it does not
+ * try to build the chain from the verify store */
+ find_chain = sk_X509_new_null();
+ }
+
/* Load all certs in the ckch into the ctx_chain for the ssl_ctx */
- if (find_chain)
#ifdef SSL_CTX_set1_chain
- if (!SSL_CTX_set1_chain(ctx, find_chain)) {
- memprintf(err, "%sunable to load chain certificate into SSL Context '%s'. Make sure you are linking against Openssl >= 1.0.2.\n",
- err && *err ? *err : "", path);
- errcode |= ERR_ALERT | ERR_FATAL;
- goto end;
- }
+ if (!SSL_CTX_set1_chain(ctx, find_chain)) {
+ memprintf(err, "%sunable to load chain certificate into SSL Context '%s'. Make sure you are linking against Openssl >= 1.0.2.\n",
+ err && *err ? *err : "", path);
+ errcode |= ERR_ALERT | ERR_FATAL;
+ goto end;
+ }
#else
{ /* legacy compat (< openssl 1.0.2) */
X509 *ca;