-
Notifications
You must be signed in to change notification settings - Fork 181
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
Merge certificates with a common second-level domain name into a sing… #57
base: master
Are you sure you want to change the base?
Conversation
…le certificate with multiple sub-names.
If this is added, it should be made optional. For instance, we are using this for 20000+ hosts, and looping over all of them every single time a certificate is renewed is not a good idea. Apart from that is a privacy issue: A single host per certificate prevents other hosts a server listens on to be leaked in the same certificate. Adding all of them in one, could make third parties wiser than they need to be. |
@Energy1190: Thanks so much for the contribution and pull request! This will be great functionality to have! I'll try to take a closer look at the code this weekend. @Eihrister: I think I agree that this should be an optional feature. Although, regarding the privacy concern, technically all certs are still discoverable by anyone via transparency logs. So I'm not sure if you knew about this (I only learned about it recently), but in light of this, does the privacy aspect still seem like as big of a deal to you? Personally, I think there's still an argument to be made that the transparency logs are less discoverable than everything being visible in a SAN certificate, but since all the info is technically out there, I just wasn't sure if you had any other thoughts. And regarding your 20000+ hosts, out of curiosity, do you have any ballpark numbers for how many of those are subdomains versus unique domains? I need to look closer at the code in this implementation, but I think that may impact how many items are actually being looped over (since I think it might be trying to pull just the subdomains for a given domain first, so the number it's looping over might be much smaller, depending on your subdomain vs domain mix). @Energy1190: As I mentioned, I need to give all this a closer look, but on a quick cursory glance, just a few notes:
So if you think you might be interested in tackling any of this, contributions are always welcome, but if this is more than you were bargaining for (the edge-cases for this unfortunately do seem rather thorny), I'm happy to try and collaborate on the functionality in this pull request (I'm just not sure when I'll have time personally). In any case, thanks again for getting the ball rolling on this feature! 🌟 🌟 |
@GUI First of all, don't get me wrong. As long as this is an optional feature, I'm all for it. Will likely be very useful to people. To us, however, not so much... and here's why: As far as privacy: Maybe privacy wasn't the right term. We host roughly 10.000 shared hosting customers. They have say 20000 names connected to their sites. Some do, some don't like it when all of their names are clearly visible in the browser. Transparency logs only state that certificates have been given out, not where or for what they are in use (though easily found, sure). Again, with this being optional, it's a non-issue. That being said, the current implementation has clear advantages as to its simplicity. Having one certificate per host makes it easy to just delete old certificates for that host after it's no longer in use on our platform. When a new host is added, a new certificate is created for that host, instead of having to revalidate all hosts within that domain. A few notes, though: With all these tens of thousands of hosts, we only found 2 customers that actually had more than the weekly rate limit of 20 certificates per domain. The rate limit only applies to newly generated certificates, renewals are exempted. Meaning those 2 customers only had to wait a week to get the rest of the certificates done. Most of the actual problems regarding the rate limit, you hit during the initial stage. Not just the 20 per domain, but also the 500 per 3 hours limit. Before enabling it for everyone, we firewalled off port 443 to only allow Let's Encrypt to connect back for verification, then curl'd all of the hosts from the local machine. Throttled to stay under the limits. This feature would reduce the time needed to generate all of those initial certificates also because of that reason: Less certificate issuances. However, again, it's only the first time. Renewals are also exempted. Also if you have only a few domains and they are quite static with so many hosts / subdomains under it, maybe this is not the solution for you and is a simple dehydrated install with a domains.txt a better option. |
The main logic is moved to b. Added checks for the maximum length, for the maximum number of names in the certificate. The functional is now optional and is called by the parameter b. Through it, you can also transfer the desired domain level.
Correction of defects
@GUI Thanks for answering. I corrected what you indicated.
I'm not sure if I can make such serious changes as replacing lua-resty-shell by lua-resty-exec. So I did not do it. And I need a lot more time to sort out the tests. |
Fixes #36 |
@Energy1190 @GUI in my opinion the public suffix list is the right and only way to split domains into "suffix" and "prefix" parts. Someone even implemented a lua module for loading and parsing the list. So users of resty-auto-ssl only need to provide a PSL file in the setttings, which I find acceptable. |
Thank you for this great discussion and pull request! For some of the more complex configurations would it be good idea if we simply created a direct communication link with dehydrated? So that if a use case is not satisfied with auto-ssl the user can still instruct dehydrate to create certificates. How will this work?
In this setup , the onus of error handling will be on the user. Although the intention of this idea is to make things easier, I can't really say if they make it more complicated instead :) |
@Energy1190: Apologies for my delayed response on this. Thanks for making the various changes, though! Since this is a more significant change, I'd still like to mull this over a bit longer just so we understand the impact and the best way to go about all this. I'm hoping I can take a closer look at this over the weekend or next week. Hopefully this isn't holding anything up on your end, but thanks again for the contribution! @luto: Thanks for the lua-psl link. That's definitely really good to know about, and could greatly simplify having to manage the huge publicsuffix list file ourselves. I'm also wondering if perhaps deferring some of this logic to a callback users could implement might be another viable approach. Sort of similar to how we leave it up to users to implement |
bump We could really use this feature as well (we keep getting "Error creating new cert :: too many certificates already issued"). For our use case, it would be perfectly find to have a callback to have users define how certificates should be grouped themselves -- love that idea! |
Merge certificates with a common second-level domain name into a single certificate with multiple sub-names.
This should help keep the limit on calls to let's encrypt api in the event that there are many third-level domains on the server.