mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
plugin/tls: respect the path specified by root plugin (#5944)
Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package grpc
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/coredns/caddy"
|
||||
"github.com/coredns/coredns/core/dnsserver"
|
||||
@@ -110,7 +111,11 @@ func parseBlock(c *caddy.Controller, g *GRPC) error {
|
||||
if len(args) > 3 {
|
||||
return c.ArgErr()
|
||||
}
|
||||
|
||||
for i := range args {
|
||||
if !filepath.IsAbs(args[i]) && dnsserver.GetConfig(c).Root != "" {
|
||||
args[i] = filepath.Join(dnsserver.GetConfig(c).Root, args[i])
|
||||
}
|
||||
}
|
||||
tlsConfig, err := pkgtls.NewTLSConfigFromArgs(args...)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user