mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
dnstap tls support (#5917)
Signed-off-by: dmachard <5562930+dmachard@users.noreply.github.com>
This commit is contained in:
@@ -30,17 +30,26 @@ func parseConfig(c *caddy.Controller) ([]*Dnstap, error) {
|
||||
|
||||
endpoint = args[0]
|
||||
|
||||
if strings.HasPrefix(endpoint, "tcp://") {
|
||||
var dio *dio
|
||||
if strings.HasPrefix(endpoint, "tls://") {
|
||||
// remote network endpoint
|
||||
endpointURL, err := url.Parse(endpoint)
|
||||
if err != nil {
|
||||
return nil, c.ArgErr()
|
||||
}
|
||||
dio := newIO("tcp", endpointURL.Host)
|
||||
dio = newIO("tls", endpointURL.Host)
|
||||
d = Dnstap{io: dio}
|
||||
} else if strings.HasPrefix(endpoint, "tcp://") {
|
||||
// remote network endpoint
|
||||
endpointURL, err := url.Parse(endpoint)
|
||||
if err != nil {
|
||||
return nil, c.ArgErr()
|
||||
}
|
||||
dio = newIO("tcp", endpointURL.Host)
|
||||
d = Dnstap{io: dio}
|
||||
} else {
|
||||
endpoint = strings.TrimPrefix(endpoint, "unix://")
|
||||
dio := newIO("unix", endpoint)
|
||||
dio = newIO("unix", endpoint)
|
||||
d = Dnstap{io: dio}
|
||||
}
|
||||
|
||||
@@ -52,6 +61,10 @@ func parseConfig(c *caddy.Controller) ([]*Dnstap, error) {
|
||||
|
||||
for c.NextBlock() {
|
||||
switch c.Val() {
|
||||
case "skipverify":
|
||||
{
|
||||
dio.skipVerify = true
|
||||
}
|
||||
case "identity":
|
||||
{
|
||||
if !c.NextArg() {
|
||||
|
||||
Reference in New Issue
Block a user