Diff

core/certmanager.lua @ 7145:b1a109858502

certmanager: Try filename.key if certificate is set to a full filename ending with .crt
author Kim Alvefur <zash@zash.se>
date Fri, 05 Feb 2016 16:12:01 +0100
parent 7144:f855ba7da30e
child 7160:5c1ee8c06235
line wrap: on
line diff
--- a/core/certmanager.lua	Fri Feb 05 15:03:39 2016 +0100
+++ b/core/certmanager.lua	Fri Feb 05 16:12:01 2016 +0100
@@ -63,14 +63,13 @@
 		local key_path = certs .. key_try[i]:format(name);
 
 		if stat(crt_path, "mode") == "file" then
-			if stat(key_path, "mode") == "file" then
-				return { certificate = crt_path, key = key_path };
-			end
 			if key_path:sub(-4) == ".crt" then
 				key_path = key_path:sub(1, -4) .. "key";
 				if stat(key_path, "mode") == "file" then
 					return { certificate = crt_path, key = key_path };
 				end
+			elseif stat(key_path, "mode") == "file" then
+				return { certificate = crt_path, key = key_path };
 			end
 		end
 	end