From cdf5ff917636530444553e297736a7e153ae6909 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 14 Apr 2014 23:09:28 +0200 Subject: certmanager: Allow non-server contexts to be without certificate and key --- core/certmanager.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/certmanager.lua b/core/certmanager.lua index 957923f5..6a53f5b2 100644 --- a/core/certmanager.lua +++ b/core/certmanager.lua @@ -87,8 +87,10 @@ function create_context(host, mode, user_ssl_config) 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 -- cgit v1.2.3