-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Allow specific issuers for specific on-demand domains #298
Comments
It's actually doable using the JSON config. See here, you can enable |
It is possible as Mohammed said, but note that this is the CertMagic repo not the Caddy repo. I'm mobile but I'll reply with details soonish |
@mbardelmeijer So, the answer to your question: "Is it possible to define that some domains may use 1 issuer and other domains another?" -- is yes. In your DecisionFunc, just return true for the domains or IPs that are allowed to get an on-demand cert, and false for the others.
I don't see how this is the case, since these are specified only per- Use the relevant Config for your domain(s); how you do this depends on your code/program, but without actual code I can't provide any more specifics that are helpful or relevant. Caddy does it, you could look at its source code. You may find |
@mholt thanks for those details -- great to hear it's possible by using separate configs! Our implementation (cleaned up) looks like below. In this format, I'm unsure how to best implement different configs per Issuer. Do we need to return a new config instance in the
|
That looks pretty good. Yeah, so if each domain has a different certmagic.Config (an issuer is just part of a Config), then you'll want to make a new Config for each one, with the right issuer(s) for each domain. |
Is that possible when using the I'm unsure how to have a singular certmagic instance with multiple configs. Is there some documentation or pseudo code available for such a setup? |
Yep. OnDemand is just a boolean flag that decides whether handshakes can trigger cert automation (and an associated DecisionFunc to allow it). When you call No need to draft psuedocode, Caddy does this very thing: https://github.com/caddyserver/caddy/blob/4943a4fc527f41e32c1770164b00980b4226f7c7/modules/caddytls/connpolicy.go#L107 Notice how it uses |
What is your question?
We use LetsEncrypt & ZeroSSL's API issuers. We prefer to configure to allow domains to use LetsEncrypt, and IP addresses the ZeroSSL API only. We can only specify a singular
DecisionFunc
and define theIssuers
globally. Is it possible to define that some domains may use 1 issuer and other domains another?What have you already tried?
No attempts have been made.
The text was updated successfully, but these errors were encountered: