aboutsummaryrefslogtreecommitdiff
path: root/plugin/tls/tls.go
diff options
context:
space:
mode:
authorGravatar Marius Kimmina <38843153+mariuskimmina@users.noreply.github.com> 2023-06-01 14:56:57 +0200
committerGravatar GitHub <noreply@github.com> 2023-06-01 08:56:57 -0400
commitd0375bc0269eccb1966ccf38a9b43263d551dee4 (patch)
tree64d3d1fff583d6c4570c017cb745f55e95f1a32c /plugin/tls/tls.go
parentcf87aa92bd21854f95d87b6cacfe758724083a85 (diff)
downloadcoredns-d0375bc0269eccb1966ccf38a9b43263d551dee4.tar.gz
coredns-d0375bc0269eccb1966ccf38a9b43263d551dee4.tar.zst
coredns-d0375bc0269eccb1966ccf38a9b43263d551dee4.zip
plugin/tls: respect the path specified by root plugin (#5944)
Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>
Diffstat (limited to 'plugin/tls/tls.go')
-rw-r--r--plugin/tls/tls.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugin/tls/tls.go b/plugin/tls/tls.go
index 2658159a9..ff60b678c 100644
--- a/plugin/tls/tls.go
+++ b/plugin/tls/tls.go
@@ -2,6 +2,7 @@ package tls
import (
ctls "crypto/tls"
+ "path/filepath"
"github.com/coredns/caddy"
"github.com/coredns/coredns/core/dnsserver"
@@ -57,6 +58,11 @@ func parseTLS(c *caddy.Controller) error {
return c.Errf("unknown option '%s'", c.Val())
}
}
+ for i := range args {
+ if !filepath.IsAbs(args[i]) && config.Root != "" {
+ args[i] = filepath.Join(config.Root, args[i])
+ }
+ }
tls, err := tls.NewTLSConfigFromArgs(args...)
if err != nil {
return err