mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-02-26 04:14:50 +01:00
token validation command parameter #201
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gertcuykens on GitHub (Feb 22, 2017).
I couldn't find a way to only repeat the challenge validation part for dns-01
When using a manual hook.sh you have to change the TXT record every time after a failed validation attempt, even if initial token is valid for several days.
It's also not clear on which dns server the txt record get checked by letsencrypt, does it check on the name server from the domain directly or just some random dns server that can take days to replicate?
When invalid you also get no details. I can only assume it just some dns replication that still didn't update the txt record.
@txr13 commented on GitHub (Feb 22, 2017):
I don't believe there's a way to retry a challenge which has already been marked invalid by the CA. According to ACME spec, "The server is said to 'finalize' the authorization when it has completed all the validations it is going to complete, and assigns the authorization a status of 'valid' or 'invalid', corresponding to whether it considers the account authorized for the identifier."
So if a DNS validation did not validate, and the CA marks it as invalid, you must get a new token and change the TXT record.
I'm not sure which servers LE uses for DNS validation, but it's recommended to insert a validation step into your
deploy_challengeto be sure the data has replicated. Some hooks (like https://github.com/AnalogJ/lexicon) just sleep for 30 seconds, while others (like https://github.com/bennettp123/dehydrated-email-notify-hook) actually perform a lookup to be sure they get the expected data back, before returning to validate the challenge. FWIW, usingdehydrated-email-notify-hookwith Google DNS has worked marvelously for me to verify replication has succeeded before the challenge gets validated with LE.@gertcuykens commented on GitHub (Feb 22, 2017):
I use the above hook script that stops at "Press enter to continue..." then I do
dig txt foo.com @ns.foo.comto check the txt record. When I see it, then I continue the script pressing enter. But it returns invalid every time without details what exactly did it check instead of the txt record i see with dig@txr13 commented on GitHub (Feb 22, 2017):
Right, but I doubt that LE is checking the authoritative nameservers for the domain directly. They're probably querying a well-known resolver (like Google DNS), which will update according to the TTL on the domain.
Note that this will not be affected by the TTL on the TXT record itself. Other resolvers will be refreshing the domain according to the zone refresh time, before they can process the new TXT record and start refreshing according to that record's individual TTL.
LE doesn't seem to give details on which DNS servers they use to do the validation. I believe this is to make it more difficult to compromise (or spoof) a given DNS resolver and use that to validate unauthenticated domains. Safest thing to do, IMO, is wait the full refresh time on the zone. Or, use a different server to perform your own verification that the data is replicating to other resolvers.
@gertcuykens commented on GitHub (Feb 22, 2017):
Ok thanks, one more thing if the domain.txt config file contains "foo.com my.foo.com" i asume the hook script get called twice?
@txr13 commented on GitHub (Feb 22, 2017):
That depends on whether you've implemented HOOK_CHAIN or not. Without it, yes, the hook will get called twice (with the validation delay in between each).
With HOOK_CHAIN implemented, you can get all the hostnames validated in a single call (per certificate).
@gertcuykens commented on GitHub (Feb 22, 2017):
Thanks, on second thought it is maybe better to still be able to split it into 2 separate commands where you can then for example kill the script after
deploy_challengeand after 48 hours launch dehydrated again with a parameter to continue where it left off?@txr13 commented on GitHub (Feb 22, 2017):
What's the advantage to that versus having the hook sleep itself for the desired length of time?
@gertcuykens commented on GitHub (Feb 22, 2017):
You can turn off your computer :)
@cpu commented on GitHub (Feb 22, 2017):
Let's Encrypt/Boulder does check authoritative nameservers directly - we do not use a well-known resolver. We choose one authoritative server at random when there are several.
@txr13 commented on GitHub (Feb 22, 2017):
@cpu Thanks for the clarification!
I'm guessing that this means that, if you have multiple authoritative nameservers (say, primary and secondary), there's a possibility that the CA queries a secondary authoritative nameserver before it's had a chance to replicate from the primary. If so, this means that we just need to ensure that all authoritative nameservers have the validation data before notifying the CA to perform validation.
@cpu commented on GitHub (Feb 22, 2017):
Yup! That's correct. Ideally you want your process to verify the correct TXT record is returned from all of your authoritative DNS servers before you ask Let's Encrypt to validate.
@gertcuykens commented on GitHub (Feb 23, 2017):
hmm i am beginning to think there is still something wrong with dns-01 in master or LE just hate ns0.transip.net. name servers. How am I going to debug this? @cpu do you work at LE can you see log files or something when I give you a domain name with a challenge record?
@cpu commented on GitHub (Feb 23, 2017):
Can you make a new thread on the community forum's help section with details of your problem? Please include the domain name - its the most directly helpful piece of information. I'll keep an eye out and can help provide insight from the Let's Encrypt server perspective as-required. Thanks!
@gertcuykens commented on GitHub (Feb 23, 2017):
done