41a6c3
diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
41a6c3
index 57b76c0..814ec4f 100644
41a6c3
--- a/modules/ssl/ssl_engine_init.c
41a6c3
+++ b/modules/ssl/ssl_engine_init.c
41a6c3
@@ -1522,70 +1522,18 @@ void ssl_init_CheckServers(SSLModConfigRec *mc, server_rec *base_server, apr_poo
41a6c3
     }
41a6c3
 }
41a6c3
 
41a6c3
-static int ssl_init_FindCAList_X509NameCmp(const X509_NAME * const *a,
41a6c3
-                                           const X509_NAME * const *b)
41a6c3
-{
41a6c3
-    return(X509_NAME_cmp(*a, *b));
41a6c3
-}
41a6c3
-
41a6c3
-static void ssl_init_PushCAList(STACK_OF(X509_NAME) *ca_list,
41a6c3
-                                server_rec *s, apr_pool_t *ptemp,
41a6c3
-                                const char *file)
41a6c3
-{
41a6c3
-    int n;
41a6c3
-    STACK_OF(X509_NAME) *sk;
41a6c3
-
41a6c3
-    sk = (STACK_OF(X509_NAME) *)
41a6c3
-             SSL_load_client_CA_file(file);
41a6c3
-
41a6c3
-    if (!sk) {
41a6c3
-        return;
41a6c3
-    }
41a6c3
-
41a6c3
-    for (n = 0; n < sk_X509_NAME_num(sk); n++) {
41a6c3
-        X509_NAME *name = sk_X509_NAME_value(sk, n);
41a6c3
-
41a6c3
-        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02209)
41a6c3
-                     "CA certificate: %s",
41a6c3
-                     SSL_X509_NAME_to_string(ptemp, name, 0));
41a6c3
-
41a6c3
-        /*
41a6c3
-         * note that SSL_load_client_CA_file() checks for duplicates,
41a6c3
-         * but since we call it multiple times when reading a directory
41a6c3
-         * we must also check for duplicates ourselves.
41a6c3
-         */
41a6c3
-
41a6c3
-        if (sk_X509_NAME_find(ca_list, name) < 0) {
41a6c3
-            /* this will be freed when ca_list is */
41a6c3
-            sk_X509_NAME_push(ca_list, name);
41a6c3
-        }
41a6c3
-        else {
41a6c3
-            /* need to free this ourselves, else it will leak */
41a6c3
-            X509_NAME_free(name);
41a6c3
-        }
41a6c3
-    }
41a6c3
-
41a6c3
-    sk_X509_NAME_free(sk);
41a6c3
-}
41a6c3
-
41a6c3
 STACK_OF(X509_NAME) *ssl_init_FindCAList(server_rec *s,
41a6c3
                                          apr_pool_t *ptemp,
41a6c3
                                          const char *ca_file,
41a6c3
                                          const char *ca_path)
41a6c3
 {
41a6c3
-    STACK_OF(X509_NAME) *ca_list;
41a6c3
-
41a6c3
-    /*
41a6c3
-     * Start with a empty stack/list where new
41a6c3
-     * entries get added in sorted order.
41a6c3
-     */
41a6c3
-    ca_list = sk_X509_NAME_new(ssl_init_FindCAList_X509NameCmp);
41a6c3
+    STACK_OF(X509_NAME) *ca_list = sk_X509_NAME_new_null();;
41a6c3
 
41a6c3
     /*
41a6c3
      * Process CA certificate bundle file
41a6c3
      */
41a6c3
     if (ca_file) {
41a6c3
-        ssl_init_PushCAList(ca_list, s, ptemp, ca_file);
41a6c3
+        SSL_add_file_cert_subjects_to_stack(ca_list, ca_file);
41a6c3
         /*
41a6c3
          * If ca_list is still empty after trying to load ca_file
41a6c3
          * then the file failed to load, and users should hear about that.
41a6c3
@@ -1619,17 +1567,12 @@ STACK_OF(X509_NAME) *ssl_init_FindCAList(server_rec *s,
41a6c3
                 continue; /* don't try to load directories */
41a6c3
             }
41a6c3
             file = apr_pstrcat(ptemp, ca_path, "/", direntry.name, NULL);
41a6c3
-            ssl_init_PushCAList(ca_list, s, ptemp, file);
41a6c3
+            SSL_add_file_cert_subjects_to_stack(ca_list, file);
41a6c3
         }
41a6c3
 
41a6c3
         apr_dir_close(dir);
41a6c3
     }
41a6c3
 
41a6c3
-    /*
41a6c3
-     * Cleanup
41a6c3
-     */
41a6c3
-    (void) sk_X509_NAME_set_cmp_func(ca_list, NULL);
41a6c3
-
41a6c3
     return ca_list;
41a6c3
 }
41a6c3