Skip to content

Commit

Permalink
fix: certificate hash encoding during lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
subnova committed Feb 19, 2024
1 parent 84bf26a commit 28b1ecd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gateway/registry/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"net/http"
"strings"
)

type RemoteRegistry struct {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 28b1ecd

Please sign in to comment.