core.certmanager: Apply TLS preset before global settings (thanks Menel)
authorKim Alvefur <zash@zash.se>
Tue, 18 Jan 2022 08:04:16 +0100
changeset 12200 b05e0b422ff7
parent 12199 c5788969b812
child 12201 95d25e620dc2
core.certmanager: Apply TLS preset before global settings (thanks Menel) Allows overriding settings via the global 'ssl' settings as before. This order was probably accidental. That said, 'ssl' is a giant footgun we will want to discourage use of.
core/certmanager.lua
--- a/core/certmanager.lua	Mon Jan 17 14:18:27 2022 +0000
+++ b/core/certmanager.lua	Tue Jan 18 08:04:16 2022 +0100
@@ -350,11 +350,11 @@
 		-- We can't read the password interactively when daemonized
 		password = function() log("error", "Encrypted certificate for %s requires 'ssl' 'password' to be set in config", host); end;
 	});
-	cfg:apply(global_ssl_config);
 	local preset = configmanager.get("*", "tls_preset") or "intermediate";
 	if preset ~= "legacy" then
 		cfg:apply(mozilla_ssl_configs[preset]);
 	end
+	cfg:apply(global_ssl_config);
 
 	for i = select('#', ...), 1, -1 do
 		cfg:apply(select(i, ...));