diff options
author | 2018-05-15 19:53:46 +0300 | |
---|---|---|
committer | 2018-05-15 12:53:46 -0400 | |
commit | bffb955f6952c197d17f028f30b6bee069b15f2b (patch) | |
tree | 9dd928f1056722b50cc466962302d821f0b0d084 | |
parent | 8026dc256097f19d8ca5cbd6f782a0d93634f85a (diff) | |
download | coredns-bffb955f6952c197d17f028f30b6bee069b15f2b.tar.gz coredns-bffb955f6952c197d17f028f30b6bee069b15f2b.tar.zst coredns-bffb955f6952c197d17f028f30b6bee069b15f2b.zip |
plugin/tls: make CA parameter optional (#1800)
-rw-r--r-- | plugin/tls/README.md | 4 | ||||
-rw-r--r-- | plugin/tls/tls.go | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/plugin/tls/README.md b/plugin/tls/README.md index 305c7772e..8a985cec7 100644 --- a/plugin/tls/README.md +++ b/plugin/tls/README.md @@ -22,9 +22,11 @@ wire data of a DNS message. ## Syntax ~~~ 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 Start a DNS-over-TLS server that picks up incoming DNS-over-TLS queries on port 5553 and uses the diff --git a/plugin/tls/tls.go b/plugin/tls/tls.go index e0958a9aa..e08e522ab 100644 --- a/plugin/tls/tls.go +++ b/plugin/tls/tls.go @@ -24,10 +24,10 @@ func setup(c *caddy.Controller) error { for c.Next() { args := c.RemainingArgs() - if len(args) != 3 { + if len(args) < 2 || len(args) > 3 { return plugin.Error("tls", c.ArgErr()) } - tls, err := tls.NewTLSConfig(args[0], args[1], args[2]) + tls, err := tls.NewTLSConfigFromArgs(args...) if err != nil { return plugin.Error("tls", err) } |