certificate.Store: Clean scope path in Load

Clean the scope path so that trimming the path from the scope works for
relative paths.
This commit is contained in:
Adnan Maolood 2021-03-05 10:51:53 -05:00
parent 649b20659b
commit e7a06a12bf

View File

@ -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)