Unable to unmarshal NewOrder request body

Hey there,
just trying out to update LE Client to ACME v2 compatible Version (using https://github.com/analogic/lescript as base for my script)
Unfortunately I’m always getting this Error: Unable to unmarshal NewOrder request body

2019-10-01 11:27:55 [info] Getting list of URLs for API
2019-10-01 11:27:56 [info] Requesting new nonce for client communication
2019-10-01 11:27:56 [info] Account already registered. Continuing.
2019-10-01 11:27:56 [info] Sending registration to letsencrypt server
2019-10-01 11:27:56 [info] Sending signed request to https://acme-staging-v02.api.letsencrypt.org/acme/new-acct
2019-10-01 11:27:57 [info] Account: https://acme-staging-v02.api.letsencrypt.org/acme/acct/ACCID
2019-10-01 11:27:57 [info] Starting certificate generation process for domains
2019-10-01 11:27:57 [info] Requesting challenge for somedomains.com
2019-10-01 11:27:57 [info] Sending signed request to https://acme-staging-v02.api.letsencrypt.org/acme/new-order
2019-10-01 11:27:58 [error] 400
{
  "type": "urn:ietf:params:acme:error:malformed",
  "detail": "Unable to unmarshal NewOrder request body",
  "status": 400
}

Someone here who could help me finding the Prob? :wink:

thx, bye from Austria
Andreas

The error means that your client sent an invalid JSON payload.

You could further debug this by printing the contents of $data in https://github.com/analogic/lescript/blob/71cce93df747923d699344927ec04c3555ad8184/Lescript.php#L414 .

1 Like

Hey @_az,
thx for your fast answer! :slight_smile:

Array
(
    [protected] => eyJhbGciOiJSUzI1NiIsIm5vbmNlIjoiMDAwMktRand0MmtJQy01WXNrc05pekRkTm1wSi1nX0NELVNzUGp0Z05fYzAwQ2ciLCJ1cmwiOiJodHRwczpcL1wvYWNtZS1zdGFnaW5nLXYwMi5hcGkubGV0c2VuY3J5cHQub3JnXC9hY21lXC9uZXctb3JkZXIiLCJraWQiOiJodHRwczpcL1wvYWNtZS1zdGFnaW5nLXYwMi5hcGkubGV0c2VuY3J5cHQub3JnXC9hY21lXC9hY2N0XC8xMTIzNzM5MiJ9
    [payload] => eyJpZGVudGlmaWVycyI6eyIwIjp7InR5cGUiOiJkbnMiLCJ2YWx1ZSI6ImZ1dHVyZXd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Wa4cPbVU4iWOXQxJ1FKglwRtg0ikdxL7d_zvKbmU44ek6fRNkE0yqdeD-UUuU7-Wcg73sfwEpX2EzOxJRbh_wbX1wdbCCj1uRcZ00GwUNqs1TU1ogRZQPhV9MiCd1kAjFZbifDGBb_8wIEn_CZv6VoY9iz4xCkYODxjq8Fs038gVorAZL79YpzTSOF-573oGEibk9rZy5T0lr6vV-WyYm6zbWFzb9vAjLvxmD1FTNkV1uE
)  

Not quite sure what could be the Problem here … mhhhh … ?

If you decode the JWS payload you can see that it is malformed per RFC 8555 (I pretty printed the JSON for readability):

{
  "identifiers": {
    "0": {
      "type": "dns",
      "value": "futureweb.at.in.futurecms.at"
    },
    "10": {
      "type": "dns",
      "value": "www.futureweb.at.in.futurecms.at"
    },
    "11": {
      "type": "dns",
      "value": "futureweb.at.ex.futurecms.at"
    },
    "12": {
      "type": "dns",
      "value": "www.futureweb.at.ex.futurecms.at"
    },
    "13": {
      "type": "dns",
      "value": "futureweb.at.ex.ortsinfo.at"
    },
    "14": {
      "type": "dns",
      "value": "www.futureweb.at.ex.ortsinfo.at"
    },
    "15": {
      "type": "dns",
      "value": "futureweb.at.dev.futurecms.at"
    },
    "16": {
      "type": "dns",
      "value": "www.futureweb.at.dev.futurecms.at"
    }
  }
}

The "identifiers" key should be an array of identifiers, not an object of identifiers, e.g. something like:

{
  "identifiers": [
    {
      "type": "dns",
      "value": "futureweb.at.in.futurecms.at"
    },
    {
      "type": "dns",
      "value": "www.futureweb.at.in.futurecms.at"
    },
    {
      "type": "dns",
      "value": "futureweb.at.ex.futurecms.at"
    },
    {
      "type": "dns",
      "value": "www.futureweb.at.ex.futurecms.at"
    },
    {
      "type": "dns",
      "value": "futureweb.at.ex.ortsinfo.at"
    },
    {
      "type": "dns",
      "value": "www.futureweb.at.ex.ortsinfo.at"
    },
    {
      "type": "dns",
      "value": "futureweb.at.dev.futurecms.at"
    },
    {
      "type": "dns",
      "value": "www.futureweb.at.dev.futurecms.at"
    }
  ]
}

Hope that helps!

Can you indicate what part of RFC 8555 you're referencing here? I'm not sure I understand. New Order isn't optional per my own understanding.

1 Like

aaarrrrggghhhhh … blind me … thank you … as so often! :wink:

as for NewOrder - please forget it … mixed up a few things … (hab notBefore in head not NewOrder … no comment :wink: )

1 Like

No problem :slight_smile: We've all been there!

1 Like

small change and all working like it should … thx again for pointing me in the right direction … guess I would have searched another few Hours without you … :grimacing:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.