refactor force ssl redirect logic

This commit is contained in:
Elvin Efendi 2019-09-23 23:40:47 -04:00
parent 73bc2cfc48
commit 8c64b12a96
5 changed files with 53 additions and 15 deletions

View file

@ -48,6 +48,14 @@ local function get_pem_cert_key(raw_hostname)
return pem_cert_key
end
function _M.configured_for_server(hostname)
if not hostname then
return false
end
return get_pem_cert_key(hostname) ~= nil
end
function _M.call()
local hostname, hostname_err = ssl.server_name()
if hostname_err then