-
Notifications
You must be signed in to change notification settings - Fork 384
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
CNAME lookups #308
Comments
i did a test with a CNAME to verify the Let's Encrypt validation. i made a DNS entry cnametest.domain1.com pointing to cnametest.domain2.com when requesting a certificate the script made _acme-challenge.cnametest under domain1.com so it seems to me that the CNAME should not be followed to the pointed hostname to find an authoritative server. Though in my test both domain1.com and domain2.com have the same authoritative nameserver. so i did a second test, with cnamegoogle.domain1.com pointing to google.com since google does not have the same authoritative nameservers as my domains. so i pointed cnamegoogle to marktplaats.nl after checking if they have CAA records.... so it seems to me that CNAME records should not be followed when determining the authoritative nameservers. unless it is to check the CAA records, but i think that should be out-of-scope for getssl. i have changed the code to be able to test these scenarios, and i'll create a pull-request in a couple of days, right now the code is a bit messy and should be cleaned up a bit before sending the PR. |
I know this ist old. But the verify error, could this come from the ACME server itself? |
In summary I am using a recent copy of getssl (getssl ver. 2.30) and have used it to obtain Let's Encrypt certificates for several domains successfully however when trying to use the cname method with references to another domain the getssl script is unable to verify the domain. Details:
If I take (getssl ver. 2.30 line 1174) and drop the "@${ns}" The check passes and the validation is performed. Line 1174 effectively translates from: What I suggested above simply allowed the domain validation to be performed in a hack sort of way. I think this needs to be fixed and it appears as if this has already been addressed? #381 Why am I seeing this behaviour? |
Thanks for the bug report, there have been a lot of changes to code which checks the DNS records have been updated since #381 so I'll take a look at the CNAME handling. |
I've just tested this using a domain I control, Namecheap DNS and the Letsencrypt staging server and everything works as expected:
Can you attach debug logs for your domain so I can see which check isn't working as expected. |
Sorry I would love to help unfortunately I can't post the logs with the names etc. As I said this is the code that is not returning the correct value: I run the command manually and it is the same result? I moved the name servers and the records to a different dns server and it worked straight away. As I leave off the @dns2.namecheaphosting.com I get the result and I get validated. Very odd indeed Thanks for looking into it but I don't think the software is buggy. |
Nice to see someone with the same issue. So much confusion surrounding this |
The other thing I have observed / determined is this is simply a preliminary test condition and will not prevent certificates from being issued because if you can get past this issue in some fashion (I simply drop the @nameserver from the dig command) then the domain validation is deemed valid by getssl. Let’s Encrypt on the other hand does not use this check directly, it performs it’s own dns check to ensure you are the owner of the domain and Let’s Encrypt has been validating my domain and issuing all the certificates I have requested even though getssl fails. |
Thanks for the updates. If you set PUBLIC_DNS_SERVER to "" then The duckdns.org servers have a similar behaviour (i.e. |
Can you test in the Thanks |
Hi @timkimber i just updated from 2.30 to 2.31 and CNAME lookups does not work anymore. Does not work:
Before the first grep was not there. I think this breaks the check. |
Hi @NicoP-S Thanks for reporting this. I remember I needed to add that line, but can't remember why. I'm happy to remove it and release as a new version if that will fix the problem for you. I'm going to add some test cases for CNAMEs as I think that's one of the problems using acme-dns (#600). Can you confirm that you have something like the following as your dns entry (example taken from a public letsencrypt forum post): |
So... this worked in earlier versions, such as v2.27 ... here's an example of a CNAME configuration:
In 2.27, et al... the drill/dig check looked like this:
... this worked beautifully... but for some reason in 2.31 ... this was changed to this...
... which of course in this case completely prevents check_result from returning the actual TXT record. So, I'm trying to figure out why this was added... at this point, we're just staying at v2.27 for now... |
@timkimber Yes our CNAME records look like this. |
This one is still an issue... |
Does #654 help? |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
I'm moving the staging server tests to use |
Excellent... we've stuck with v2.27 as a result of this bug. Glad to see it getting some love. |
Any update on this issue? |
Sorry, I've just not had time to progress this, although it's high on my list of things I want to fix. I'll do the quick bug fixes next then start on this |
Quick bump on this... curious if you've made any progress. |
@sidrew I got 80% of the way to making it work, then ran out of time. Now that I'm sort-of on top of bugs/issues I'll see if I can find what I did last time and complete it. |
@sidrew can you try the version in the |
@timkimber I see what you've done with the script... looks like the CNAME check is happening in get_auth_dns() ... which should work. However, this is only called if the user isn't specifying a DNS server... as we are. So... the code to check and handle a CNAME isn't being called. |
Thanks @sidrew I've managed to reproduce the CNAME problem by setting a DNS_SERVER, I'll work on a better fix |
Awesome, @timkimber ... it looks like that CNAME discovery block could be jammed in a separate function... yeah? |
Hi @sidrew I've updated the version in the |
@timkimber ... there we go... now she's working. Thanks for the effort! |
@timkimber ... I think this one is ready to merge and close... yeah? |
@sidrew it is, I'm just fixing one broken test and then I can merge the changes |
i suddenly have an error on one of my domains where the authorative DNS-server lookup fails, i'm looking into it and trying to debug it, and now i'm wondering why the workflow is the way it is....
(i'm thinking my DNS-provider changed something on their servers causing this to suddenly fail)
what i don't understand is that it is looking for a CNAME and then follows the CNAME, but the CNAME could point to a different domain, which has a different authorative nameserver.
I'd think that you should only go up the domain ladder if there isn't a NS record for the domain, and don't follow the CNAME.
for instance if cname.example.com is a CNAME record for google.com the authorative server should be the nameserver for example.com and not google.com
i think it should be that if there aren't any NS records for cname.example.com the script should check example.com for the NS records.
for test.cname.example.com it should first lookup the NS for test.cname.example.com, then cname.example.com and last example.com
it seems to me that it doesn't make sense to follow the CNAME since even if cname.example.com points to test.example.com and test.example.com has it's own authorative nameservers still the nameservers for example.com should be checked used for cname.example.com
The text was updated successfully, but these errors were encountered: