From e7a06a12bf5b79db2d68fe25e41e487f03c1650a Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Fri, 5 Mar 2021 10:51:53 -0500 Subject: [PATCH] certificate.Store: Clean scope path in Load Clean the scope path so that trimming the path from the scope works for relative paths. --- certificate/store.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/certificate/store.go b/certificate/store.go index 83e4ffe..f5847b4 100644 --- a/certificate/store.go +++ b/certificate/store.go @@ -191,7 +191,8 @@ func (s *Store) Load(path string) error { continue } - scope := strings.TrimPrefix(crtPath, path) + scope := filepath.Clean(crtPath) + scope = strings.TrimPrefix(crtPath, filepath.Clean(path)) scope = strings.TrimPrefix(scope, "/") scope = strings.TrimSuffix(scope, ".crt") s.Add(scope, cert)