Hi there,
I'm currently trying to implement ACME according to RFC 8555 as part of our web server's automated SSL issuance.
I'm getting the following error and after lots of trial and error - I'm stuck. This is the error I'm getting:
{
type: 'urn:ietf:params:acme:error:malformed',
detail: 'Parse error reading JWS',
status: 400
}
Here is the POST request body that I'm sending to LetsEncrypt's Staging ACME newAccount endpoint; along with a random key pair I used:
JWS after encoding/signature
{
protected: 'eyJhbGciOiJSUzI1NiIsImp3ayI6eyJrdHkiOiJSU0EiLCJuIjoiamE5SXJhNEdnVUVPMXlZcDF5YnBtNnoydU5aMmN3LUNSTkVHSEhzNHY4WVRCa1NnWTZDM1RzdGMxLXBwSXV2ZklZOVhaRGVtMzd6VkZPNUxZZHY3SF9BV1J6VV9neDV1Uk1hTXNXNzlXVGRiZlVHRzAyeDVjSzlfU0p2TDNCNHlfZlVuZGpfanBWQlVvMEo0ZElqazYxY2ZxWFEyVVdBa2NtNVVrekljLXVsd1czcWdkWUpETm5iTFFUVWR5d200Y0VxckJrTkUzdl9GTWEwZnNSd3NSaV9ISWpGZmRGNHFKZE9zb2tfcG9yQVBsVklBTlRRTUxscG9XLURZVzN3Y2RMTmpBMmxBWmRPX1hhOUVkS1l6R01DRlFMSHpXMkVWSzJwa2xXUDJBUjRaS2lsZ3d4cEdhZkR1U0tnYnpxdFRRQk5oRjQ5bTJSNWR4RmMxTDA4ajZ3IiwiZSI6IkFRQUIifSwibm9uY2UiOiIwMDAzM2c1bERsaUhLTl96WFRtRnZuV2NQR3Jab2FXVnVxZ01HeWc0cG5NQUUxVSIsInVybCI6Imh0dHBzOi8vYWNtZS1zdGFnaW5nLXYwMi5hcGkubGV0c2VuY3J5cHQub3JnL2FjbWUvbmV3LWFjY3QifQ',
payload: 'eyJ0ZXJtc09mU2VydmljZUFncmVlZCI6dHJ1ZSwiY29udGFjdCI6WyJtYWlsdG86c3VwcG9ydEBnZW50bGVudC5jb20iXX0',
signature: 'eyJhbGciOiJSUzI1NiIsImp3ayI6eyJrdHkiOiJSU0EiLCJuIjo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zB7rC1bw'
}
JWS before encoding/signature
{
protected: {
alg: 'RS256',
jwk: {
kty: 'RSA',
n: 'ja9Ira4GgUEO1yYp1ybpm6z2uNZ2cw-CRNEGHHs4v8YTBkSgY6C3Tstc1-ppIuvfIY9XZDem37zVFO5LYdv7H_AWRzU_gx5uRMaMsW79WTdbfUGG02x5cK9_SJvL3B4y_fUndj_jpVBUo0J4dIjk61cfqXQ2UWAkcm5UkzIc-ulwW3qgdYJDNnbLQTUdywm4cEqrBkNE3v_FMa0fsRwsRi_HIjFfdF4qJdOsok_porAPlVIANTQMLlpoW-DYW3wcdLNjA2lAZdO_Xa9EdKYzGMCFQLHzW2EVK2pklWP2AR4ZKilgwxpGafDuSKgbzqtTQBNhF49m2R5dxFc1L08j6w',
e: 'AQAB'
},
nonce: '00033g5lDliHKN_zXTmFvnWcPGrZoaWVuqgMGyg4pnMAE1U',
url: 'https://acme-staging-v02.api.letsencrypt.org/acme/new-acct'
},
payload: {
termsOfServiceAgreed: true,
contact: [ 'mailto:support@gentlent.com' ]
}
}
RSA 2048-bit Key Pair
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAja9Ira4GgUEO1yYp1ybpm6z2uNZ2cw+CRNEGHHs4v8YTBkSg
Y6C3Tstc1+ppIuvfIY9XZDem37zVFO5LYdv7H/AWRzU/gx5uRMaMsW79WTdbfUGG
02x5cK9/SJvL3B4y/fUndj/jpVBUo0J4dIjk61cfqXQ2UWAkcm5UkzIc+ulwW3qg
dYJDNnbLQTUdywm4cEqrBkNE3v/FMa0fsRwsRi/HIjFfdF4qJdOsok/porAPlVIA
NTQMLlpoW+DYW3wcdLNjA2lAZdO/Xa9EdKYzGMCFQLHzW2EVK2pklWP2AR4ZKilg
wxpGafDuSKgbzqtTQBNhF49m2R5dxFc1L08j6wIDAQABAoIBAGNutRm2PLhvGOQi
01A77cwj6Y40bDI5mxmCe8B3NY9YibdnaAwjGSICFCkvSBOK5y/dMd6SM9lm4z9q
MJr/z9BNJMVa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Vy/OCJvUXRx29I+556
+uoXrNA2BKnZ2sESjEdFsTVVMe9r7YxU3WC6rkfuDAUOzqU2+d3c
-----END RSA PRIVATE KEY-----
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAja9Ira4GgUEO1yYp1ybp
m6z2uNZ2cw+CRNEGHHs4v8YTBkSgY6C3Tstc1+ppIuvfIY9XZDem37zVFO5LYdv7
H/AWRzU/gx5uRMaMsW79WTdbfUGG02x5cK9/SJvL3B4y/fUndj/jpVBUo0J4dIjk
61cfqXQ2UWAkcm5UkzIc+ulwW3qgdYJDNnbLQTUdywm4cEqrBkNE3v/FMa0fsRws
Ri/HIjFfdF4qJdOsok/porAPlVIANTQMLlpoW+DYW3wcdLNjA2lAZdO/Xa9EdKYz
GMCFQLHzW2EVK2pklWP2AR4ZKilgwxpGafDuSKgbzqtTQBNhF49m2R5dxFc1L08j
6wIDAQAB
-----END PUBLIC KEY-----
I hope someone is able to point me in the right direction so I can solve this.
-Tom