On Tue, Apr 07, 2026 at 12:49:35 +0200, Sebastian Robin Nielsen wrote:
> I missed the fact that the CSR (INSIDE the JSON object) also should be
> b64_url encoded.
> 
> So you had to do a b64 --> b64_url transisiton on the PEM CSR.
> 
> Whats the rationale behind this?
> 
> Logically, the outer container is b64_url encoded, and thus the whole
> container is "protected" against any sheninigans that can happen during
> POSTing.
> 
> Thus the inner container (the CSR) doesn't need to be urlsafe encoded, since
> the "outer container" protects the enviroment from the bogus/invalid
> characters.
> 
> So why this thing in the RFC 8555 standard?

Hi,

all authenticated requests share a common format:
{
     "protected": base64url({...}),
     "payload": base64url({...}),
     "signature": "..."
}

I.e. payload must be the base64url encoding of some json object.
For the "finalize" endpoint, the payload (currently) only holds the
"csr". That CSR must be a valid json string.

The CSR itself is a binary blob (X.690 / DER format) that needs to be encoded
into a string.

One option, of course, would've been the PEM format. But it's ambigious and you 
need a PEM encoder/decoder.
The much simpler option is to use what you've already got everywhere else in 
rfc8555: base64url.

Hope that helps :)


n.b.: The issued certificate chain is usually downloaded in PEM format :-)

_______________________________________________
Acme mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to