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.
This commit is contained in:
Joris Vink 2020-02-21 13:58:03 +01:00
parent 82d7b58405
commit 9e5e698e4b
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}