mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-09 07:15:04 -05:00
Unable to perform an HTTP Let's Encrypt certificate request behind Pangolin reverse proxy #155
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @q20 on GitHub (Mar 17, 2025).
Good day!
I have a Home Assistant installation which requires a local certificate for secure MQTT. Rather than self-sign, I have previously used the Let's Encrypt addon with DNS/API request to cloudflare, allowing me to deploy any certificate of my choosing.
Now, however, I have opted to deploy Pangolin as reverse proxy, negating the need to store those API credentials in plain text on the HA installation, as Pangolin correctly registers a valid cert for its reverse proxy,
ha.example.com. This reverse proxy works via Pangolin exactly as expected.Local MQTT is still an issue, though. When attempting an HTTP certificate request for the same FQDN,
ha.example.com, the request errors with the following:Let's just assume that it's absolutely necessary Home Assistant is able to deploy its own, managed, Let's Encrypt cert before workarounds are suggested. 😜
I have a hunch this is not working because Pangolin upgrades all requests to HTTPS, so the HTTP challenge, on port 80, fails. But that's just my gut feeling. When I disable SSL for this resource in Pangolin, Let's Encrypt fails with the same error.
Any ideas? How can Pangolin resources successfully request their own certificates?
@miloschwartz commented on GitHub (Mar 17, 2025):
This usually indicates the HTTP-01 challenge has failed when attempting to validate the certificate. This is probably happening because port 80 is not open on the HA instance since it's now being proxied. I think you would have to use DNS validation here (DNS-01 challenge) instead, or find a work around.
@q20 commented on GitHub (Mar 17, 2025):
This is why I'm suggesting that this perhaps be looked at as a feature request:
Is it possible to allow Pangolin-proxied hosts to successfully complete Let’s Encrypt HTTP certificate challenges independently?
@rayjaymor85 commented on GitHub (Mar 23, 2025):
As far as I know, this would take a fair degree of engineering and the use-case for this is very niche.
I had to do something very similar to get Nextcloud working as I am very insistent on not exposing it to the internet and only running it behind a VPN, making SSL certbot quite tricky.
I ended up doing the DNS-01 challenge method, this docker command worked well for me in that it generated the required keys.
The downside is this needs to be done every 90 days, I'm sure there is an ACME tool out there than can automate this if you use Cloudflare as that's what PfSense and Proxmox uses but I've not looked much into it just yet especially as I'm learning Ansible atm anyway and confident this can be handled there.
docker run --rm -it -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" certbot/certbot certonly --manual --preferred-challenges dnsJust take the generated certificates and line them up to where Home Assistant needs them.
Note that in my Nextcloud case, I didn't need to use my reverse proxy anymore so not sure if this causes any clashes with Traefik.
@q20 commented on GitHub (Mar 24, 2025):
Ah, I guess I had assumed this would be far easier to implement than it clearly is.
Yes, I guess my use-case is niche, but I could imagine more users making use of the feature, were it available.
Case in point:
Pangolin is used to secure access to multiple micro-services at multiple sites. These services are secured by their own 2FA, so Pangolin simply brokers the connection and is responsible for managing the certificate for each. Let's say we go with wildcards, leveraging Cloudflare's API. Great, now we have those micro-services secured for
service1.siteA.example.com,service1.siteB.example.com, etc.On-site, we might now have a device,
service2wanting to securely connect toservice1.siteA.example.com. Split-DNS ensuresservice1is resolved locally, meaning we can connect to it directly, without looping back via internet.Unfortunately, locally,
service1.siteA.example.comis using a self-signed certificate, soservice2refuses connection.The way I do things now, is I (as suggested) use a DNA-01 challenge to provide any number of valid certificates to be used internally, on-site.
This comes with a glaring caveat, security-wise - Cloudflare cannot issue DNS edit API keys for a sub-zone (sub-domain), which means every site has an API key able to rewrite/edit/modify the entire root
example.comDNS zone. Absolutely a potential security issue.I thought Pangolin might allow an HTTP challenge for all its unprotected resources, permitting
service1.siteA.example.comto successfully manage its own, non-wildcard certificate locally.Does that make sense? It's purely a security concern: distributing root edit rights to multiple sites has me feeling uneasy.
@github-actions[bot] commented on GitHub (Apr 11, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
@github-actions[bot] commented on GitHub (Apr 26, 2025):
This issue has been automatically closed due to inactivity. If you believe this is still relevant, please open a new issue with up-to-date information.