Hi, I write after exhausting everything else I can think of.
I am looking to integrate implement Acme and have been testing my implementation against the staging server while cross referencing 'dehydrated' - the bash client.
But I cannot get create account to work and it's really hard to know what I'm doing wrong because the error information isn't extensive.
I think I am sending the right information, here's an example - don't worry there's no leakage here the keys are all throw away anyway:
thank you! that's interesting because the RFC8555 example has no such ordering...
in both the payload and the protected? because I just changed the payload and it made no difference to my error!
When you sign (meaning encrypt) the string of "base64(protected json)"."base64(payload json)" with your account key, the order of the json data matters because the ciphertext of the signature will differ when the order of the json data differs.
See lines 94 - 278 of my certsage.php for a working example using an RSA account key. There will only be a slight modification for EC account key. Line 122 might warrant special focus.
Maybe I am just missing something fundamental... it's possible!
But can you see that I have written code to verify my signature?
My verify does this:
take the JSON keys for protected and payload
base64url decode them into strings
import the key (from JSON decoded object versions of the strings)
put the strings back together with ".": protected.payload
verify that data with the sig from the JSON
If Acme is doing something different then ok. But nothing says that and I don't understand what you're saying about reordering... the text of the file I'm importing above is:
In your next message you say to look at your example and point out the base64-url encoding... I am not sure why you're doing that. I will look at your implementation but my point is I've been over implementations and I can't see what I'm doing different and I can't see why Acme is responding negatively when my own verifications tests check out.
But thanks so much for taking the time to try to help a fellow implementor.
For each of protected and payload, which should be json object strings, you need to base64-encode the json object string then URL-encode the result. Then you concatenate those URL-encoded protected and payload strings with a period in between then sign the resulting string. That signature then needs to be base64-encoded and URL-encoded. Then you construct a json object containing the URL-encoded versions of protected, payload, and signature (in that order) and send the resulting json object string as the HTTP body via POST.
Yes! I know!
I was explaining how I verify what I've made not how I produce it.
I am doing exactly what you say. I am also able to verify what I produce with the code above.
But when I POST to let's encrypt staging server it still gives me the same result.
I guess I should test it with someone else's imlementation to see if staging works at all.
Maybe it doesn't.
I get that. That's why I am asking for help. Because I think I am doing everything correctly and yet I am getting an error from staging and it's not an informative error.
Nothing you've said so far (I am not criticizing your help!) has been something wrong in my implementation.
Guess I'll check staging and come back here with more info.
I am not sure why you think any of that ordering matters, it certainly doesn't seem to OR it does but my error is before it even gets to that.
But again, as an implementor I don't understand why the server would reorder what I am sending it. Surely it just does basically what my verification example does above. So why would it need to reorder keys?
Anyway, as I say, I tried it that way. It doesn't make any difference:
No, it won't help.
As I said at the beginning I've been through everything I could find, including that thread.
My understanding of that issues is that they were sending the wrongly formatted webkeys...
It does have good advice though: write a test for what you're generating to prove that it works.
I did that. My test works.
Let's encrypt staging doesn't.
This is why it would be super useful to get a version of the code they use so I could run locally and check the basics.
I always say if someone isn't prepared to give you the code they run in staging there must be something fishy.
I'm sure that's not true with letsencrypt... everything is FOSS surely?