]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: crt-list do ckchn_lookup
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 10 Oct 2019 09:38:13 +0000 (11:38 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 11 Oct 2019 15:32:02 +0000 (17:32 +0200)
src/ssl_sock.c

index 726ffb279de3cfe50c90680ecbcdd3c3ee7efed8..ca48a65ea61d83fe142c1e0a269fe5a8a02de9a7 100644 (file)
@@ -3853,23 +3853,19 @@ int ssl_sock_load_cert_list_file(char *file, struct bind_conf *bind_conf, struct
                        break;
                }
 
-               if (stat(crt_path, &buf) == 0) {
-
-                       ckchn =  ckchn_load_cert_file(crt_path, 0,  err);
-                       if (!ckchn)
-                               cfgerr++;
-                       else
-                               cfgerr = ssl_sock_load_ckchn(crt_path, ckchn, bind_conf, ssl_conf,
-                                                            &args[cur_arg], arg - cur_arg - 1, err);
-               } else {
-                       ckchn =  ckchn_load_cert_file(crt_path, 1,  err);
-                       if (!ckchn)
-                               cfgerr++;
+               if ((ckchn = ckchn_lookup(crt_path)) == NULL) {
+                       if (stat(crt_path, &buf) == 0)
+                               ckchn = ckchn_load_cert_file(crt_path, 0,  err);
                        else
-                               cfgerr = ssl_sock_load_multi_ckchn(crt_path, ckchn, bind_conf, ssl_conf,
-                                                                  &args[cur_arg], arg - cur_arg - 1, err);
+                               ckchn = ckchn_load_cert_file(crt_path, 1,  err);
                }
 
+               if (!ckchn)
+                       cfgerr++;
+               else
+                       cfgerr += ssl_sock_load_ckchn(crt_path, ckchn, bind_conf, ssl_conf,
+                                                     &args[cur_arg], arg - cur_arg - 1, err);
+
                if (cfgerr) {
                        memprintf(err, "error processing line %d in file '%s' : %s", linenum, file, *err);
                        break;