-
Welcome
What did you expect to see?Nothing What did you see instead?
How do you use lego?Library Reproduction stepsI am following the example of getting certificate from the https://go-acme.github.io/lego/usage/library/ but I get this error. Version of legov4.6.0 LogsThe client will print but request := certificate.ObtainRequest{Domains: domains, Bundle: true}
client.Certificate.Obtain(request) will return
Go environment (if applicable)
I don't think this is a bug but something is missing. Maybe the example I followed is incomplete or I might be doing something wrong... |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hello, I don't reproduce your problem with the code provided in the example and a local instance of an ACME server or a real ACME server. Can you provide more information? |
Beta Was this translation helpful? Give feedback.
-
so the first step was to create account:
Then i took the key and saved it into storage as account's private key. To create/renew the certificate, I load the key and create client instance
I set the
which gives me that jwt error. I am obviously running this on live server. |
Beta Was this translation helpful? Give feedback.
-
I think this might be because in
which I think could be the missing JWT key id. The thing is that the registration object exists only when I registered my account. So I no longer have access to that object - ever. I think I could fake it and preserve the registration/account URI, which is just LE uri with account id suffix, so the code above could fill it in. But I don't think I can find the registration uri now - or my account id. I'll try to figure something out. |
Beta Was this translation helpful? Give feedback.
-
Yes, that was the issue. So when you register you have to save the account id along with the private key and email. Then, when you create new client instance, you have to provide it with user that has the registration object set and the uri must be filled with |
Beta Was this translation helpful? Give feedback.
Yes, that was the issue. So when you register you have to save the account id along with the private key and email. Then, when you create new client instance, you have to provide it with user that has the registration object set and the uri must be filled with
https://acme-v02.api.letsencrypt.org/acme/acct/[your account id]
. You should update the documentation and possibly make the key id as required argument if the registration object is not present and create empty version of it automatically.