Skip to content

Commit

Permalink
Fix the SCT header return value from the API to base64 encode it.
Browse files Browse the repository at this point in the history
I don't actually know what's correct here - but the current client expects
it to be base64 encoded. We could keep it "raw", but then we have to fix the client
that's currently in cosign.

Signed-off-by: Dan Lorenc <lorenc.d@gmail.com>
  • Loading branch information
dlorenc committed Dec 21, 2021
1 parent d77d444 commit 47a0939
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/api/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func signingCert(w http.ResponseWriter, req *http.Request) {
}

// Set the SCT and Content-Type headers, and then respond with a 201 Created.
w.Header().Add("SCT", string(sctBytes))
w.Header().Add("SCT", base64.StdEncoding.EncodeToString(sctBytes))
w.Header().Add("Content-Type", "application/pem-certificate-chain")
w.WriteHeader(http.StatusCreated)
// Write the PEM encoded certificate chain to the response body.
Expand Down

0 comments on commit 47a0939

Please sign in to comment.