aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-03-05 10:51:53 -0500
committerAdnan Maolood <[email protected]>2021-03-05 10:51:55 -0500
commite7a06a12bf5b79db2d68fe25e41e487f03c1650a (patch)
treec757ede6d3cce4eabcfbb3b0b7989761f3ecbacf
parentRevert "certificate: Remove Subject from CreateOptions" (diff)
downloadgo-gemini-e7a06a12bf5b79db2d68fe25e41e487f03c1650a.tar.xz
go-gemini-e7a06a12bf5b79db2d68fe25e41e487f03c1650a.zip
certificate.Store: Clean scope path in Load
Clean the scope path so that trimming the path from the scope works for relative paths.
-rw-r--r--certificate/store.go3
1 files changed, 2 insertions, 1 deletions
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)