From 28b1ecd35318d1250dd348bf6dfc96c2a0a98065 Mon Sep 17 00:00:00 2001 From: Dale Peakall Date: Mon, 19 Feb 2024 14:45:01 +0000 Subject: [PATCH] fix: certificate hash encoding during lookup --- gateway/registry/remote.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gateway/registry/remote.go b/gateway/registry/remote.go index 29922ac..13c1176 100644 --- a/gateway/registry/remote.go +++ b/gateway/registry/remote.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "net/http" + "strings" ) type RemoteRegistry struct { @@ -59,6 +60,9 @@ type CertificateResponse struct { } func (r RemoteRegistry) LookupCertificate(certHash string) (*x509.Certificate, error) { + certHash = strings.Replace(certHash, "/", "_", -1) + certHash = strings.Replace(certHash, "-", "+", -1) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/api/v0/certificate/%s", r.ManagerApiAddr, certHash), nil) if err != nil { return nil, fmt.Errorf("creating http request: %w", err)