Skip to content

Commit 28b1ecd

Browse files
committed
fix: certificate hash encoding during lookup
1 parent 84bf26a commit 28b1ecd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gateway/registry/remote.go

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"io"
99
"net/http"
10+
"strings"
1011
)
1112

1213
type RemoteRegistry struct {
@@ -59,6 +60,9 @@ type CertificateResponse struct {
5960
}
6061

6162
func (r RemoteRegistry) LookupCertificate(certHash string) (*x509.Certificate, error) {
63+
certHash = strings.Replace(certHash, "/", "_", -1)
64+
certHash = strings.Replace(certHash, "-", "+", -1)
65+
6266
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/api/v0/certificate/%s", r.ManagerApiAddr, certHash), nil)
6367
if err != nil {
6468
return nil, fmt.Errorf("creating http request: %w", err)

0 commit comments

Comments
 (0)