commit e4caac9e0c6f310c8e379e7f56fba493c95a8667
parent bf42e56c7d5d8b2315e758c6ee1ee546bc77b068
Author: Joris Vink <joris@coders.se>
Date: Tue, 26 Mar 2019 21:36:45 +0100
Be more clear when an invalid TLS setup is found
Diffstat:
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/config.c b/src/config.c
@@ -234,6 +234,11 @@ kore_parse_config(void)
kore_parse_config_file(fp);
(void)fclose(fp);
+#if !defined(KORE_NO_TLS)
+ if (tls_dhparam == NULL)
+ fatal("incomplete TLS setup: no DH parameters provided");
+#endif
+
if (!kore_module_loaded())
fatal("no application module was loaded");
@@ -323,8 +328,16 @@ kore_parse_config_file(FILE *fp)
}
#endif
- if (!strcmp(p, "}") && current_domain != NULL)
+ if (!strcmp(p, "}") && current_domain != NULL) {
+#if !defined(KORE_NO_TLS)
+ if (current_domain->certfile == NULL ||
+ current_domain->certkey == NULL) {
+ fatal("incomplete TLS setup for '%s'",
+ current_domain->domain);
+ }
+#endif
current_domain = NULL;
+ }
if (!strcmp(p, "}")) {
lineno++;