Add Lua module to serve SSL Certificates dynamically

This commit is contained in:
Henry Tran 2018-06-05 09:51:22 -04:00
parent b214282057
commit cbf041fc3e
6 changed files with 578 additions and 2 deletions

View file

@ -85,6 +85,15 @@ http {
else
monitor = res
end
{{ if $all.DynamicCertificatesEnabled }}
ok, res = pcall(require, "certificate")
if not ok then
error("require failed: " .. tostring(res))
else
certificate = res
end
{{ end }}
}
{{ if $all.DynamicConfigurationEnabled }}
@ -775,6 +784,12 @@ stream {
ssl_stapling on;
ssl_stapling_verify on;
{{ end }}
{{ if and (not $all.DisableLua) $all.DynamicCertificatesEnabled}}
ssl_certificate_by_lua_block {
certificate.call()
}
{{ end }}
{{ end }}
{{ if not (empty $server.AuthTLSError) }}