From e58b549d0f63a343b917f9930638a44b54e5ef1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 18 Nov 2024 19:02:53 +0800 Subject: [PATCH] Fix "Fix reloading of tls.certificate_path, tls.key_path and tls.ech.key_path" --- common/tls/ech_server.go | 6 +++++- common/tls/std_server.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/tls/ech_server.go b/common/tls/ech_server.go index 00b24fd5..c38fe673 100644 --- a/common/tls/ech_server.go +++ b/common/tls/ech_server.go @@ -97,8 +97,12 @@ func (c *echServerConfig) startWatcher() error { if err != nil { return err } + err = c.watcher.Start() + if err != nil { + return err + } c.watcher = watcher - return c.watcher.Start() + return nil } func (c *echServerConfig) credentialsUpdated(path string) error { diff --git a/common/tls/std_server.go b/common/tls/std_server.go index 82ea9134..e894dade 100644 --- a/common/tls/std_server.go +++ b/common/tls/std_server.go @@ -106,8 +106,12 @@ func (c *STDServerConfig) startWatcher() error { if err != nil { return err } + err = c.watcher.Start() + if err != nil { + return err + } c.watcher = watcher - return c.watcher.Start() + return nil } func (c *STDServerConfig) certificateUpdated(path string) error {