# HG changeset patch # User Kim Alvefur # Date 1397509768 -7200 # Node ID 6498554adb0d4b418827d83015ca546d7e297b3f # Parent 4a1fdd72e98a0b68347d2804febb78f1757126cc certmanager: Allow non-server contexts to be without certificate and key diff -r 4a1fdd72e98a -r 6498554adb0d core/certmanager.lua --- a/core/certmanager.lua Mon Apr 14 23:00:44 2014 +0200 +++ b/core/certmanager.lua Mon Apr 14 23:09:28 2014 +0200 @@ -87,8 +87,10 @@ end end - 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 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 + end -- LuaSec expects dhparam to be a callback that takes two arguments. -- We ignore those because it is mostly used for having a separate