From 9e5e698e4b74a39f601dc1610cb7fb37c4bae56c Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Fri, 21 Feb 2020 13:58:03 +0100 Subject: [PATCH] only count TLS enabled domains as primary_dom. Otherwise one can run into trouble with ACME if it was enabled on domains but the first domain in the configuration was a non TLS domain. --- src/domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/domain.c b/src/domain.c index 0ec8f93..4b57234 100644 --- a/src/domain.c +++ b/src/domain.c @@ -219,6 +219,10 @@ kore_domain_attach(struct kore_domain *dom, struct kore_server *server) dom->server = server; TAILQ_INSERT_TAIL(&server->domains, dom, list); + /* The primary domain should be attached to a TLS context. */ + if (server->tls == 0 && dom == primary_dom) + primary_dom = NULL; + return (KORE_RESULT_OK); }