From fe36378134119cf06b5290ac8021ef39ea13ebab Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Thu, 28 Dec 2017 17:32:56 +0100
Subject: certmanager: Check for missing certificate before key in
 configuration (should be marginally less confusing)

---
 core/certmanager.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/certmanager.lua b/core/certmanager.lua
index f343b6d7..1cbdac5d 100644
--- a/core/certmanager.lua
+++ b/core/certmanager.lua
@@ -176,8 +176,8 @@ local function create_context(host, mode, ...)
 	local user_ssl_config = cfg:final();
 
 	if mode == "server" then
-		if not user_ssl_config.key then return nil, "No key present in SSL/TLS configuration for "..host; end
 		if not user_ssl_config.certificate then return nil, "No certificate present in SSL/TLS configuration for "..host; end
+		if not user_ssl_config.key then return nil, "No key present in SSL/TLS configuration for "..host; end
 	end
 
 	for option in pairs(path_options) do
-- 
cgit v1.2.3