Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ http {
Additional configuration options can be set on the `auto_ssl` instance that is created:

### `allow_domain`
*Default:* `function(domain, auto_ssl) return false end`
*Default:* `function(domain, auto_ssl, ssl_options) return false end`

A function that determines whether the incoming domain should automatically issue a new SSL certificate.

Expand All @@ -154,6 +154,8 @@ auto_ssl:set("allow_domain", function(domain, auto_ssl)
end)
```

Use `ssl_options` to make the behavior vary based on port - see the example in listed for `request_domain` for details.

### `dir`
*Default:* `/etc/resty-auto-ssl`

Expand Down
2 changes: 1 addition & 1 deletion lib/resty/auto-ssl/ssl_certificate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ local function get_cert_der(auto_ssl_instance, domain, ssl_options)
-- We may want to consider caching the results of allow_domain lookups
-- (including negative caching or disallowed domains).
local allow_domain = auto_ssl_instance:get("allow_domain")
if not allow_domain(domain, auto_ssl_instance) then
if not allow_domain(domain, auto_ssl_instance, ssl_options) then
return nil, "domain not allowed"
end

Expand Down