You need to sign in or sign up before continuing.
Commit bffb955f authored by Ruslan Drozhdzh's avatar Ruslan Drozhdzh Committed by John Belamaric

plugin/tls: make CA parameter optional (#1800)

parent 8026dc25
...@@ -22,9 +22,11 @@ wire data of a DNS message. ...@@ -22,9 +22,11 @@ wire data of a DNS message.
## Syntax ## Syntax
~~~ txt ~~~ txt
tls CERT KEY CA tls CERT KEY [CA]
~~~ ~~~
Parameter CA is optional. If not set, system CAs can be used to verify the client certificate
## Examples ## Examples
Start a DNS-over-TLS server that picks up incoming DNS-over-TLS queries on port 5553 and uses the Start a DNS-over-TLS server that picks up incoming DNS-over-TLS queries on port 5553 and uses the
......
...@@ -24,10 +24,10 @@ func setup(c *caddy.Controller) error { ...@@ -24,10 +24,10 @@ func setup(c *caddy.Controller) error {
for c.Next() { for c.Next() {
args := c.RemainingArgs() args := c.RemainingArgs()
if len(args) != 3 { if len(args) < 2 || len(args) > 3 {
return plugin.Error("tls", c.ArgErr()) return plugin.Error("tls", c.ArgErr())
} }
tls, err := tls.NewTLSConfig(args[0], args[1], args[2]) tls, err := tls.NewTLSConfigFromArgs(args...)
if err != nil { if err != nil {
return plugin.Error("tls", err) return plugin.Error("tls", err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment