mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 10:13: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:
		| @@ -4,6 +4,7 @@ import ( | ||||
| 	"crypto/tls" | ||||
| 	"errors" | ||||
| 	"fmt" | ||||
| 	"path/filepath" | ||||
| 	"strconv" | ||||
| 	"time" | ||||
|  | ||||
| @@ -165,6 +166,7 @@ func parseStanza(c *caddy.Controller) (*Forward, error) { | ||||
| } | ||||
|  | ||||
| func parseBlock(c *caddy.Controller, f *Forward) error { | ||||
| 	config := dnsserver.GetConfig(c) | ||||
| 	switch c.Val() { | ||||
| 	case "except": | ||||
| 		ignore := c.RemainingArgs() | ||||
| @@ -230,7 +232,11 @@ func parseBlock(c *caddy.Controller, f *Forward) error { | ||||
| 		if len(args) > 3 { | ||||
| 			return c.ArgErr() | ||||
| 		} | ||||
|  | ||||
| 		for i := range args { | ||||
| 			if !filepath.IsAbs(args[i]) && config.Root != "" { | ||||
| 				args[i] = filepath.Join(config.Root, args[i]) | ||||
| 			} | ||||
| 		} | ||||
| 		tlsConfig, err := pkgtls.NewTLSConfigFromArgs(args...) | ||||
| 		if err != nil { | ||||
| 			return err | ||||
|   | ||||
		Reference in New Issue
	
	Block a user