Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request_domain can set fullchain_der, privkey_der on ssl_options #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/resty/auto-ssl/ssl_certificate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,16 @@ local function issue_cert(auto_ssl_instance, storage, domain)
end

local function get_cert_der(auto_ssl_instance, domain, ssl_options)
-- Look for the certificate in shared memory first.
local fullchain_der = ngx.shared.auto_ssl:get("domain:fullchain_der:" .. domain)
local privkey_der = ngx.shared.auto_ssl:get("domain:privkey_der:" .. domain)
local fullchain_der, privkey_der
if ssl_options["fullchain_der"] and ssl_options["privkey_der"] then
-- Look in ssl_options first in case request_domain has set it
fullchain_der = ssl_options["fullchain_der"]
privkey_der = ssl_options["privkey_der"]
else
-- Look for the certificate in shared memory first.
fullchain_der = ngx.shared.auto_ssl:get("domain:fullchain_der:" .. domain)
privkey_der = ngx.shared.auto_ssl:get("domain:privkey_der:" .. domain)
end
if fullchain_der and privkey_der then
return {
fullchain_der = fullchain_der,
Expand Down