400 Bad Request #1

Open
by Ghost opened 3 years ago · 4 comments
Ghost commented 3 years ago

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' } ```

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
Created https://git.coolaj86.com/coolaj86/acme-dns-01-digitalocean.js/pulls/3
Owner

Thanks. I'll merge this.

Thanks. I'll merge this.

@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

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.