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

Use lego binary to handle HTTP-01 challenge #1763

Closed
accuser opened this issue Mar 14, 2025 · 3 comments
Closed

Use lego binary to handle HTTP-01 challenge #1763

accuser opened this issue Mar 14, 2025 · 3 comments
Milestone

Comments

@accuser
Copy link
Contributor

accuser commented Mar 14, 2025

Since #1753 the DNS-01 challenge is handled with the lego binary. HTTP-01 challenge can also now be handled with the lego binary.

Proposed changes:

  • Add core.http_address to config.
  • Add well-known HTTP server to incusd that is enabled when core.http_address is valid. This new server simply serves files from the .well-known subfolder of var root (i.e., /var/lib/incus).
  • When updating certificates using HTTP-01 challenge, call lego with the --http.port [port] --http.webroot [webroot] settings so that the challenge token is written to the file system folder [webroot]/.well-known/acme-challenge/ and available via http://[domain]:[port]/.well-known/acme-challenge/[token]

I have this as a PoC in a local branch, but want to sense check this approach first before submitting a PR @stgraber.

@stgraber
Copy link
Member

SO in general, we don't want Incus to have an HTTP listener, we only do HTTPS.

Can lego itself run the http server during validation?

@stgraber stgraber added this to the incus-6.11 milestone Mar 14, 2025
@accuser
Copy link
Contributor Author

accuser commented Mar 14, 2025

It can - I'm just testing now. If this works, I'll submit a PR shortly.

@accuser
Copy link
Contributor Author

accuser commented Mar 14, 2025

I've just submitted PR #1770, now with no HTTP serving .well-known files. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants