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