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