400 Bad Request #1

Open
opened 2021-07-08 17:37:42 +00:00 by Ghost · 4 comments

Seeing the following when using greenlock with my digitalocean application:

Error cert_issue:
Error response. Check token, baseUrl, domains, etc.
Error: Error response. Check token, baseUrl, domains, etc.
    at /root/rtag-proxy/node_modules/acme-dns-01-digitalocean/lib/index.js:34:11
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
'acme-dns-01-digitalocean' did not return a Promise when called. This should be fixed by the maintainer.
400 https://api.digitalocean.com/v2/domains/rtag.dev/records

Request:
{
  method: 'POST',
  url: 'https://api.digitalocean.com/v2/domains/rtag.dev/records',
  headers: {
    Authorization: 'Bearer xxxx',
    'Content-Type': 'application/x-www-form-urlencoded',
    'User-Agent': 'rtag-proxy/1.0.0 Greenlock_Express/4.0.4 ACME.js/3.1.0 node/v16.4.1 linux/5.4.0-73-generic Linux/x64',
    Accept: 'application/json'
  },
  json: true,
  form: {
    type: 'TXT',
    name: '_greenlock-dryrun-08c2eab5',
    data: 'KdqOjUPHbzAT96R4xUy3ymtXXcC01DXZTAewU0Hgvlk',
    ttl: 300
  }
}

Response:
{
  id: 'bad_request',
  message: "invalid character 'y' in literal true (expecting 'r')",
  request_id: '87b81818-e65d-4d54-bd41-23a2bc45c84c'
}
Seeing the following when using greenlock with my digitalocean application: ``` Error cert_issue: Error response. Check token, baseUrl, domains, etc. Error: Error response. Check token, baseUrl, domains, etc. at /root/rtag-proxy/node_modules/acme-dns-01-digitalocean/lib/index.js:34:11 at processTicksAndRejections (node:internal/process/task_queues:96:5) 'acme-dns-01-digitalocean' did not return a Promise when called. This should be fixed by the maintainer. 400 https://api.digitalocean.com/v2/domains/rtag.dev/records Request: { method: 'POST', url: 'https://api.digitalocean.com/v2/domains/rtag.dev/records', headers: { Authorization: 'Bearer xxxx', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'rtag-proxy/1.0.0 Greenlock_Express/4.0.4 ACME.js/3.1.0 node/v16.4.1 linux/5.4.0-73-generic Linux/x64', Accept: 'application/json' }, json: true, form: { type: 'TXT', name: '_greenlock-dryrun-08c2eab5', data: 'KdqOjUPHbzAT96R4xUy3ymtXXcC01DXZTAewU0Hgvlk', ttl: 300 } } Response: { id: 'bad_request', message: "invalid character 'y' in literal true (expecting 'r')", request_id: '87b81818-e65d-4d54-bd41-23a2bc45c84c' } ```
Author

From what I can tell, the digitalocean api expects Content-Type: application/json , not application/x-www-form-urlencoded: https://developers.digitalocean.com/documentation/v2/#create-a-new-domain-record

Maybe we should be using json instead of form here: 9f86ee8d32/lib/index.js (L22)

From what I can tell, the digitalocean api expects `Content-Type: application/json `, not `application/x-www-form-urlencoded`: https://developers.digitalocean.com/documentation/v2/#create-a-new-domain-record Maybe we should be using `json` instead of `form` here: https://git.rootprojects.org/root/acme-dns-01-digitalocean.js/src/commit/9f86ee8d32dc45d998c10e46178eeb3e3a870fe8/lib/index.js#L22
Author
Created https://git.coolaj86.com/coolaj86/acme-dns-01-digitalocean.js/pulls/3
Owner

Thanks. I'll merge this.

Thanks. I'll merge this.
Author

@coolaj86 are you still open to merging my PR?

@coolaj86 are you still open to merging my PR?
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: root/acme-dns-01-digitalocean.js#1
No description provided.