400 Bad Request #1

Open
2021-07-08 17:37:42 +00:00 geopend door Ghost · 4 opmerkingen

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
Eigenaar

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?
Log in om deel te nemen aan deze discussie.
Geen label
Geen mijlpaal
Niet toegewezen
2 deelnemers
Notificaties
Vervaldatum
De deadline is ongeldig of buiten bereik. Gebruik het formaat 'jjjj-mm-dd'.

Geen vervaldatum ingesteld.

Afhankelijkheden

Geen afhankelijkheden ingesteld.

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