From bda2a9f5e658ece94763641ba3c7fc1f2d39140b Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Wed, 23 Aug 2023 17:19:01 +0800 Subject: [PATCH] d --- restagent/config/config.go | 1 + restagent/restagent.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/restagent/config/config.go b/restagent/config/config.go index accd5313..e87d8841 100644 --- a/restagent/config/config.go +++ b/restagent/config/config.go @@ -36,6 +36,7 @@ type YamlConfig struct { IPv6 string `yaml:"ipv6"` Port uint16 `yaml:"port"` Schema string `yaml:"schema"` + CaFile string `yaml:"caFile"` CertFile string `yaml:"certFile"` KeyFile string `yaml:"keyFile"` } `yaml:"rest"` diff --git a/restagent/restagent.go b/restagent/restagent.go index 94011906..d1a73d6a 100644 --- a/restagent/restagent.go +++ b/restagent/restagent.go @@ -158,7 +158,7 @@ func main() { if rest.IPv4 != "" { listen := rest.IPv4 + ":" + strconv.Itoa(int(rest.Port)) if strings.ToLower(rest.Schema) == "https" { - go HttpListenTLS(listen, rest.CertFile, rest.KeyFile, router) + go HttpListenConfigTLS(listen, rest.CaFile, rest.CertFile, rest.KeyFile, router) } else { go HttpListen(listen, router) } @@ -168,7 +168,7 @@ func main() { if rest.IPv6 != "" { listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port)) if strings.ToLower(rest.Schema) == "https" { - go HttpListenTLS(listenv6, rest.CertFile, rest.KeyFile, router) + go HttpListenConfigTLS(listenv6, rest.CaFile, rest.CertFile, rest.KeyFile, router) } else { go HttpListen(listenv6, router) }