# Automatic HTTPS with lets-encrypt?

**URL:** <https://forums.balena.io/t/automatic-https-with-lets-encrypt/5463>\
**Category:** openBalena\
**Created:** [February 26, 2019, 1:12pm UTC](https://forums.balena.io/t/automatic-https-with-lets-encrypt/5463 "2019-02-26T13:12:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![whm](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@whm](https://forums.balena.io/u/whm)\
**Post date:** [February 26, 2019, 1:12pm UTC](https://forums.balena.io/t/automatic-https-with-lets-encrypt/5463/1 "2019-02-26T13:12:57Z")

</div>

The self-signed certificates are rather tiresome, for several reasons:

- Extra work to make sure the certificate is trusted in all the right places. (Node, System, etc.)
- Security risk. I’m installing openBalena on a client server, but for convenience I would like to have balena cli running on my laptop. This client has rather lousy security practices, so it’s quite likely that the https connections.
- Open issues. Many of us are experiencing deploy errors which are caused by the untrusted certificate. ([1](https://forums.balena.io/t/open-balnea-preload-image-error-x509-certificate-signed-by-unknown-authority/4824), [2](https://forums.balena.io/t/open-balnea-preload-image-error-x509-certificate-signed-by-unknown-authority/4824), [3](https://forums.balena.io/t/deploying-app-to-registry-in-open-balena-getting-x509-error/4558))

Would the maintainers be open to a PR replacing the haproxy load balancer with caddy web server which automatically configures HTTPS using lets encrypt?

Thanks!

---

<div class="post-metadata">

**Author:** ![richbayliss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/richbayliss/32/1054_2.png) [@richbayliss](https://forums.balena.io/u/richbayliss)\
**Post date:** [February 26, 2019, 3:20pm UTC](https://forums.balena.io/t/automatic-https-with-lets-encrypt/5463/7 "2019-02-26T15:20:14Z")

</div>

We appreciate that it is not ideal to only have self-signed certificates officially supported in openBalena. We are working in the background on a HAproxy-based container which would allow this autogeneration via an ACMEv2 provider, but it isn’t available at this time.

Thanks for the offer of contributing to the project; generally we are very open to PRs from the community for openBalena and any PRs will be responded to. I am not sure moving to Caddy would be desirable in this instance, since the issue you would find here is that port 443 is not being used exclusively for HTTPS/TLS traffic; it is also being split off for the VPN traffic which requires certain introspection, which I don’t think is supported in Caddy.

---

<div class="post-metadata">

**Author:** ![whm](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@whm](https://forums.balena.io/u/whm)\
**Post date:** [March 1, 2019, 5:39pm UTC](https://forums.balena.io/t/automatic-https-with-lets-encrypt/5463/9 "2019-03-01T17:39:24Z")

</div>

> [@richbayliss](#):
>
> I am not sure moving to Caddy would be desirable in this instance, since the issue you would find here is that port 443 is not being used exclusively for HTTPS/TLS traffic; it is also being split off for the VPN traffic which requires certain introspection, which I don’t think is supported in Caddy.

I don’t completely understand, but I’m glad to hear you appreciate the problem and are working on a solution. 👍

I think Caddy and Haproxy could be used together. Haproxy would split off the VPN traffic but Caddy would handle the HTTPS routing.

---

<div class="post-metadata">

**Author:** ![richbayliss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/richbayliss/32/1054_2.png) [@richbayliss](https://forums.balena.io/u/richbayliss)\
**Post date:** [March 5, 2019, 4:35pm UTC](https://forums.balena.io/t/automatic-https-with-lets-encrypt/5463/11 "2019-03-05T16:35:54Z")

</div>

I have PR’d a solution to the LetsEncrypt certificate requirement. It will need to go through review, but if you’re interested in taking a look you can find the PR here: [https://github.com/balena-io/open-balena/pull/38](https://github.com/balena-io/open-balena/pull/38)

We may still make changes to this, so please don’t consider it to be final; I plan to make a post about how to utilise the changes once they are approved and merged.

---

<div class="post-metadata">

**Author:** ![whm](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@whm](https://forums.balena.io/u/whm)\
**Post date:** [March 7, 2019, 12:06pm UTC](https://forums.balena.io/t/automatic-https-with-lets-encrypt/5463/13 "2019-03-07T12:06:36Z")

</div>

Awesome! Thanks for working on that.
