Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dose this have to be that complicated? #16

Open
jimmywarting opened this issue Apr 27, 2023 · 1 comment
Open

Dose this have to be that complicated? #16

jimmywarting opened this issue Apr 27, 2023 · 1 comment

Comments

@jimmywarting
Copy link

acme-easy/index.js

Lines 249 to 272 in f8a034c

async function getPemCertChain(nonce, jwk, accountUrl, certUrl) {
const header = {
alg: "ES256",
kid: accountUrl,
nonce: nonce,
url: certUrl
}
const payload = ""
const jwt = await jwtFromJson(jwk, header, payload)
const res = await fetch(certUrl, {
method: "POST",
headers: {
"Content-Type": "application/jose+json",
"Accept": "application/pem-certificate-chain"
},
body: JSON.stringify(parseJwt(jwt))
})
if (res.status >= 400)
throw new Error(res.statusText)
const pemCertChain = parsePemCertChain(await res.text())

i was using staging and i just tried to do:

fetch(certUrl).then(res => res.text())

and it seemed to work out just fine... didn't need to use any jwt, post, header, or anything complicated.

@JonahGroendal
Copy link
Owner

It may work for letsencrypt but I believe the ACME standard requires a post-as-get request, but I could be wrong.

https://www.rfc-editor.org/rfc/rfc8555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants