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