6953a2
diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
6953a2
index 70d151e..e4f5fc8 100644
6953a2
--- a/modules/ssl/ssl_engine_init.c
6953a2
+++ b/modules/ssl/ssl_engine_init.c
6953a2
@@ -1095,7 +1095,9 @@ static apr_status_t ssl_init_ctx_crl(server_rec *s,
6953a2
 /*
6953a2
  * Read a file that optionally contains the server certificate in PEM
6953a2
  * format, possibly followed by a sequence of CA certificates that
6953a2
- * should be sent to the peer in the SSL Certificate message.
6953a2
+ * should be sent to the peer in the SSL Certificate message.  Returns
6953a2
+ * 0 on success, otherwise the OpenSSL error stack contents should be
6953a2
+ * reported.
6953a2
  */
6953a2
 static int use_certificate_chain(
6953a2
     SSL_CTX *ctx, char *file, int skipfirst, pem_password_cb *cb)
6953a2
@@ -1128,8 +1130,10 @@ static int use_certificate_chain(
6953a2
         ctx->extra_certs = NULL;
6953a2
     }
6953a2
 #endif
6953a2
+
6953a2
     /* create new extra chain by loading the certs */
6953a2
     n = 0;
6953a2
+    ERR_clear_error();
6953a2
     while ((x509 = PEM_read_bio_X509(bio, NULL, cb, NULL)) != NULL) {
6953a2
         if (!SSL_CTX_add_extra_chain_cert(ctx, x509)) {
6953a2
             X509_free(x509);
6953a2
@@ -1190,6 +1194,7 @@ static apr_status_t ssl_init_ctx_cert_chain(server_rec *s,
6953a2
     if (n < 0) {
6953a2
         ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01903)
6953a2
                 "Failed to configure CA certificate chain!");
6953a2
+        ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
6953a2
         return ssl_die(s);
6953a2
     }
6953a2
 
6953a2
diff --git a/modules/ssl/ssl_util_ocsp.c b/modules/ssl/ssl_util_ocsp.c
6953a2
index b11a6e9..b66e151 100644
6953a2
--- a/modules/ssl/ssl_util_ocsp.c
6953a2
+++ b/modules/ssl/ssl_util_ocsp.c
6953a2
@@ -363,7 +363,9 @@ static STACK_OF(X509) *modssl_read_ocsp_certificates(const char *file)
6953a2
         BIO_free(bio);
6953a2
         return NULL;
6953a2
     }
6953a2
+
6953a2
     /* create new extra chain by loading the certs */
6953a2
+    ERR_clear_error();
6953a2
     while ((x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL)) != NULL) {
6953a2
         if (!other_certs) {
6953a2
                 other_certs = sk_X509_new_null();