Skip to content
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

Avoid specifying on demand 'ask' endpoint when using my own issuer #5986

Closed
jroyalty opened this issue Dec 15, 2023 · 8 comments · Fixed by #6055
Closed

Avoid specifying on demand 'ask' endpoint when using my own issuer #5986

jroyalty opened this issue Dec 15, 2023 · 8 comments · Fixed by #6055
Labels
question ❔ Help is being requested

Comments

@jroyalty
Copy link

I've written my own tls.issuance module, similar to tls.issuance.internal. I want to use on-demand behavior here but without any limits; that is, I don't want to specify an ask endpoint or any rate_limit configuration in this case.

I see that Caddy has a strict set of conditions under which an ask endpoint isn't enforced -- namely that you are using only tls.issuance.internal. I certainly understand these safe guards being in place, but I'm wondering if there has been consideration given to how one might opt-out of these when needed.

Cheers!

@mholt
Copy link
Member

mholt commented Dec 16, 2023

(The rate_limit has always been optional anyway.)

You could set up a simple ask endpoint (within Caddy itself, just a site that's bound to localhost) that always returns 200 OK.

@mholt mholt added the question ❔ Help is being requested label Dec 16, 2023
@francislavoie
Copy link
Member

francislavoie commented Dec 16, 2023

For example:

{
	on_demand_tls {
		ask http://localhost:5555/
	}
}

http://localhost:5555 {
	respond 200
}

https:// {
	tls {
		on_demand
		issuer your-issuer
	}

	# your usual config
}

@jroyalty
Copy link
Author

Thanks for the response, and the suggestion. I tried this previously and while it works, I'm looking for a way to avoid the network call during the cert pipeline. Perhaps this could be a module with a default that has the same behavior as the current ask?

@francislavoie
Copy link
Member

Yeah, we'll probably add tls.on_demand.decision module support at some point. But until then, the above solution is the simplest and fastest. The HTTP request to Caddy is extremely fast, so you won't notice any kind of bottleneck there.

@jroyalty
Copy link
Author

Okay, consider this a +1 for the module. :)

@ankon
Copy link
Contributor

ankon commented Jan 22, 2024

See #6055

@mholt
Copy link
Member

mholt commented Jan 23, 2024

@jroyalty Would you be able to try #6055? Or at least inspect it to see if that works for you?

@jroyalty
Copy link
Author

@mholt I looked at the PR and it seems to fit the bill! I'll give it a try as well. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question ❔ Help is being requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants