Skip to content

Commit 0c7b608

Browse files
committed
Pass ssl_options to allow_domain
This allows different checks based on the port the request came in.
1 parent a9633ab commit 0c7b608

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ http {
138138
Additional configuration options can be set on the `auto_ssl` instance that is created:
139139

140140
### `allow_domain`
141-
*Default:* `function(domain, auto_ssl) return false end`
141+
*Default:* `function(domain, auto_ssl, ssl_options) return false end`
142142

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

@@ -154,6 +154,8 @@ auto_ssl:set("allow_domain", function(domain, auto_ssl)
154154
end)
155155
```
156156

157+
Use `ssl_options` to make the behavior vary based on port - see the example in listed for `request_domain` for details.
158+
157159
### `dir`
158160
*Default:* `/etc/resty-auto-ssl`
159161

lib/resty/auto-ssl/ssl_certificate.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ local function get_cert_der(auto_ssl_instance, domain, ssl_options)
129129

130130
-- Check to ensure the domain is one we allow for handling SSL.
131131
local allow_domain = auto_ssl_instance:get("allow_domain")
132-
if not allow_domain(domain, auto_ssl_instance) then
132+
if not allow_domain(domain, auto_ssl_instance, ssl_options) then
133133
return nil, "domain not allowed"
134134
end
135135

0 commit comments

Comments
 (0)