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

Add support for custom certificate provider (ACME server) #1298

Open
3 tasks done
strarsis opened this issue Jun 5, 2021 · 6 comments
Open
3 tasks done

Add support for custom certificate provider (ACME server) #1298

strarsis opened this issue Jun 5, 2021 · 6 comments
Milestone

Comments

@strarsis
Copy link
Contributor

strarsis commented Jun 5, 2021

Summary

It would be helpful to add support for custom CA servers (ACME compatible, so basically a LE drop-in replacement).

Motivation

A Trellis local server for local testing should use an existing, private CA (ACME-compatible; smallstep-ca).

Additional context

Related:
#893
#1066

@swalkinshaw
Copy link
Member

This would just be an alternative to how Trellis currently creates a self-signed certificate for local development right? I assume needing a custom CA/ACME server would be very rare for other use cases with Trellis.

@swalkinshaw
Copy link
Member

I've actually been working on a refactor of TLS certificates with Trellis using Certbot which step would theoretically work nicely with. But to trust the CA, the tool would have to be run both on your host machine and the VM. Which of course means installing step on both.

While it seems nice to take advantage of certbot and just set a different ACME url in dev, there's also https://github.com/FiloSottile/mkcert which seems simpler overall. Though the same caveat applies, it would have to be installed and run both locally and remotely (which Trellis can help manage).

@strarsis
Copy link
Contributor Author

strarsis commented Aug 18, 2021

I am using the smallstep CA server and my own CA private key / intermediate private key for signing everything locally used (for internal/development use). All devices trust that CA cert so I can centrally manage the trusted certs without creating a mess.
That would be the rationale behind this feature: A development/local staging server can sign its cert for HTTPS using the local smallstep CA server.

@swalkinshaw
Copy link
Member

@strarsis I believe #1310 which I'm hoping to merge soon should solve this for you?

Although considering your use case, it has pros and cons. It would definitely let you override acme_ca_server with your custom one and then you'd have secure HTTPS in development.

However, right now this will always install smallstep and create a CA locally on the server in development which isn't needed in your case. It's not a huge deal, just slower + inefficient, but I'll see if I can make that optional.

@strarsis
Copy link
Contributor Author

strarsis commented Aug 4, 2022

Yes, the usage of certbot by that PR should make switching the CA URL much easier.
When the new PR is merged I can test how easy it would be to use a local CA for a staging Trellis server.

@swalkinshaw
Copy link
Member

I improved #1310 so that the local step-ca server won't be installed if a non-local CA server is specified. So in this case, you can just override the variable in development to whatever your CA host is and everything should work as expected 😄

@swalkinshaw swalkinshaw added this to the v2.0 milestone Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants