a42d0f
diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
a42d0f
index 4e2e80d..10a2c86 100644
a42d0f
--- a/modules/ssl/ssl_engine_init.c
a42d0f
+++ b/modules/ssl/ssl_engine_init.c
a42d0f
@@ -2256,51 +2256,6 @@ int ssl_proxy_section_post_config(apr_pool_t *p, apr_pool_t *plog,
a42d0f
     return OK;
a42d0f
 }
a42d0f
 
a42d0f
-static int ssl_init_FindCAList_X509NameCmp(const X509_NAME * const *a,
a42d0f
-                                           const X509_NAME * const *b)
a42d0f
-{
a42d0f
-    return(X509_NAME_cmp(*a, *b));
a42d0f
-}
a42d0f
-
a42d0f
-static void ssl_init_PushCAList(STACK_OF(X509_NAME) *ca_list,
a42d0f
-                                server_rec *s, apr_pool_t *ptemp,
a42d0f
-                                const char *file)
a42d0f
-{
a42d0f
-    int n;
a42d0f
-    STACK_OF(X509_NAME) *sk;
a42d0f
-
a42d0f
-    sk = (STACK_OF(X509_NAME) *)
a42d0f
-             SSL_load_client_CA_file(file);
a42d0f
-
a42d0f
-    if (!sk) {
a42d0f
-        return;
a42d0f
-    }
a42d0f
-
a42d0f
-    for (n = 0; n < sk_X509_NAME_num(sk); n++) {
a42d0f
-        X509_NAME *name = sk_X509_NAME_value(sk, n);
a42d0f
-
a42d0f
-        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02209)
a42d0f
-                     "CA certificate: %s",
a42d0f
-                     modssl_X509_NAME_to_string(ptemp, name, 0));
a42d0f
-
a42d0f
-        /*
a42d0f
-         * note that SSL_load_client_CA_file() checks for duplicates,
a42d0f
-         * but since we call it multiple times when reading a directory
a42d0f
-         * we must also check for duplicates ourselves.
a42d0f
-         */
a42d0f
-
a42d0f
-        if (sk_X509_NAME_find(ca_list, name) < 0) {
a42d0f
-            /* this will be freed when ca_list is */
a42d0f
-            sk_X509_NAME_push(ca_list, name);
a42d0f
-        }
a42d0f
-        else {
a42d0f
-            /* need to free this ourselves, else it will leak */
a42d0f
-            X509_NAME_free(name);
a42d0f
-        }
a42d0f
-    }
a42d0f
-
a42d0f
-    sk_X509_NAME_free(sk);
a42d0f
-}
a42d0f
 
a42d0f
 static apr_status_t ssl_init_ca_cert_path(server_rec *s,
a42d0f
                                           apr_pool_t *ptemp,
a42d0f
@@ -2324,7 +2279,7 @@ static apr_status_t ssl_init_ca_cert_path(server_rec *s,
a42d0f
         }
a42d0f
         file = apr_pstrcat(ptemp, path, "/", direntry.name, NULL);
a42d0f
         if (ca_list) {
a42d0f
-            ssl_init_PushCAList(ca_list, s, ptemp, file);
a42d0f
+            SSL_add_file_cert_subjects_to_stack(ca_list, file);
a42d0f
         }
a42d0f
         if (xi_list) {
a42d0f
             load_x509_info(ptemp, xi_list, file);
a42d0f
@@ -2341,19 +2296,13 @@ STACK_OF(X509_NAME) *ssl_init_FindCAList(server_rec *s,
a42d0f
                                          const char *ca_file,
a42d0f
                                          const char *ca_path)
a42d0f
 {
a42d0f
-    STACK_OF(X509_NAME) *ca_list;
a42d0f
-
a42d0f
-    /*
a42d0f
-     * Start with a empty stack/list where new
a42d0f
-     * entries get added in sorted order.
a42d0f
-     */
a42d0f
-    ca_list = sk_X509_NAME_new(ssl_init_FindCAList_X509NameCmp);
a42d0f
+    STACK_OF(X509_NAME) *ca_list = sk_X509_NAME_new_null();;
a42d0f
 
a42d0f
     /*
a42d0f
      * Process CA certificate bundle file
a42d0f
      */
a42d0f
     if (ca_file) {
a42d0f
-        ssl_init_PushCAList(ca_list, s, ptemp, ca_file);
a42d0f
+        SSL_add_file_cert_subjects_to_stack(ca_list, ca_file);
a42d0f
         /*
a42d0f
          * If ca_list is still empty after trying to load ca_file
a42d0f
          * then the file failed to load, and users should hear about that.
a42d0f
@@ -2377,11 +2326,6 @@ STACK_OF(X509_NAME) *ssl_init_FindCAList(server_rec *s,
a42d0f
         return NULL;
a42d0f
     }
a42d0f
 
a42d0f
-    /*
a42d0f
-     * Cleanup
a42d0f
-     */
a42d0f
-    (void) sk_X509_NAME_set_cmp_func(ca_list, NULL);
a42d0f
-
a42d0f
     return ca_list;
a42d0f
 }
a42d0f