-
Notifications
You must be signed in to change notification settings - Fork 121
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
Confusion on base documentation #304
Comments
Some familiarity with ACME is required and expected in order for you to use this library to implement to ACME workflow. It may be worth reading through https://www.rfc-editor.org/rfc/rfc8555.html to understand what's expected to happen but the general flow is:
Do you need to implement your own ACME workflow or could you use an established ACME client tool (https://certifytheweb.com etc) to achieve the same result? |
I did managed to get the challenge validated by using a while loop to wait it out. I still get the same error message when I get to I'm trying to implement my own ACME workflow using YARP because LettuceEncrypt doesn't work very well. I don't know why Microsoft insists on using LettuceEncrypt. |
I'd imagine the author of that having been a member of their team has some considerable weight. Ok, so once you have one challenge per identifier validated (so if your cert has domain.com and www.domain.com on it then you'd have two challenges to complete) you can move on to polling the Order until it's status is valid or ready, if you jump straight to Generate without checking the order first then it may not be ready yet (it can take a few seconds to transition from pending/valid to ready). |
I don't see how to validate the order. It won't allow me to wait for the status change. The status shows That error happens after I created the pfxBuilder, so it's not coming from the generate function. |
WaitingForActivation means you forgot to await an async task and the object you have is the task, not the result. The "pretend pear" issue is that you are testing with Let's Encrypt staging and Certes by default has never heard of this (fake) root certificate. To override that you need to use using (TextReader textReader = new StringReader(certAsPemString))
{
var pemReader = new PemReader(textReader);
var pemObj = pemReader.ReadPemObject();
var certBytes = pemObj.Content;
_issuerCertCache.Add(certBytes);
} where certAsPemString is the root cert in PEM format. You can grab them from https://github.com/letsencrypt/website/tree/master/static/certs/staging |
I don't see an async task; I just see order.Resource().Result.Status Other than that, it worked. I have successfully created the pfx file. The thing was I had to create a poll for validating the challenge. I was hitting |
Cool, it's best practise to make your method async and await the task (order.Resource() is a task) rather than accessing .Result directly but if it works for you that's all that matters. |
I am getting The certutil command did give me some warnings though |
@webprofusion-chrisc do you have an example of the polling?
var order = await acme.NewOrder(new[] { "mytest.test.com" });
var authz = (await order.Authorizations()).First();
var dnsChallenge = await authz.Dns();
var dnsTxt = acme.AccountKey.DnsTxt(dnsChallenge.Token);
Console.WriteLine(dnsTxt);
var challengeResult = await dnsChallenge.Validate();
// Polling? |
@HaroldH76 I use a loop to fetch the latest version of the challenge status and test the status to see if it's valid. There could be other better ways: https://github.com/webprofusion/certify/blob/development/src/Certify.Providers/ACME/Certes/CertesACMEProvider.cs#L1103 |
I have written an extension method for my http challenge: Extension method:
Usage:
|
The link @webprofusion-chrisc posted seams to be broken. This should be the code he is referencing:
|
Sorry, can't we make a callback to the validate method to check the status? |
The ACME certificate authority (such as let's Encrypt) is remote API, it doesn't have a connection to your machine to notify you of changes, you have to poll the authorization status to see if it is still pending (still being validated) or if it has failed or succeeded. |
What's the difference between the Could you comment? |
I found the answer here: |
I'm trying to follow the instructions in the documentation for the http challenge, but it fails at "await order.Generate". The error says "Order's status ("pending") is not acceptable for finalization".
I do have the endpoint ".well-known/acme-challenge/" open for file downloads. However, the docs doesn't say how the file should be formed nor how the file should be returned.
The httpChallenge.Validate() function does hit the endpoint with only the token value.
On my server, the file name is saved as "token.key" and the endpoint returns the file name as "token.key" as well, so the the endpoint does search for the key pair.
I don't know what I am missing to get this to work. The only thing I can think of is that the validation is being hit too soon, but I don't know if that's the case.
The text was updated successfully, but these errors were encountered: