r/linuxadmin • u/Haunting_Meal296 • Oct 27 '25
Need advise to decide https certificate approach
Hi, we are working on an embedded linux project that hosts a local web dashboard through Nginx. The web UI let the user configure hardware parameters (it’s not public-facing), usually accessed via local IP.
We’ve just added HTTPS support and now need to decide how to handle certificates long-term.
A) Pre-generate one self-signed cert and include it in the rootfs
B) Dynamically generate a self-signed cert on each build
C) Use a trusted CA e.g. Let’s Encrypt or a commercial/internal CA.
We push software updates every few weeks.. The main goal is to make HTTPS stable and future-proof, the main reason is that later we’ll add login/auth and maybe integrate cloud services (Onedrive, Samba, etc.)
For this kind of semi-offline embedded product, what is considered best practice for HTTPS certificate management? Thank you for your help
15
u/serverhorror Oct 27 '25
Option D)
Generate a self signed cert on first startup. Then let the users add their own cert (and CA) if they choose to do so.
If you need to know the certificate it should be somewhere an option that allows me to register my certificate with your system.
I don't want you to be in possession of the cert, ever.
2
u/michaelpaoli Oct 27 '25
C - and automate the sh*t out of it. :-) And yes, needs be a domain in public Internet DNS for that, but that doesn't mean you need to expose the actual web server or the like. Just need to use DNS or wee bit of http to validate for certs (needs be DNS for wildcards). That's basically it. I've got programs I've written, I type one command, and I have cert(s) in minutes or less, and including wildcard, SAN, multiple domains ... easy peasy. Even done versions of same that handle multiple DNS infrastructures (ISC BIND 9, f5 GTM, AWS Route 53) as needed, in heterogeneous environments, to get the needed certs - even when the domain(s) in the cert span multiple such distinct infrastructures.
And yeah, you don't wanna be doing A nor B.
3
u/Le_Vagabond Oct 27 '25 edited Oct 27 '25
you can only do A or B if the access is through the IP. that's basically the standard way for stuff like cameras or small IoT devices like this, users have to click through the warning page "this website is untrusted".
if you want proper certificates, you need a proper FQDN, and this just doesn't happen when your users are mainstream consumers, the kind for whom "access those devices via local IP" is already a stretch. if you sell those devices to professionals you could ask them to route *.yourdomain.com to the IPs internally, and have valid C certificates that way.
the "best practice" route for those things nowadays is to have a cloud-based config tool that you as the vendor hosts, with clean certificates because it's on your domain, that pushes to or is polled by the devices for config changes. it's a LOT more difficult than it sounds and it exposes you to fun stuff like GDPR.
you could also get the devices to reach out to your hosting and establish a reverse tunnel with a dynamically generated subdomain and certificate. I tend to frown upon stuff doing that without permission, though.
2
u/rakpet Oct 27 '25
The best would be C but I don't think it would be possible if this is not internet facing. In that case go for B. If possible, additionally allow users to import their own
5
u/Il_Falco4 Oct 27 '25
Option d: put Proxy on front that takes care of SSL certs. ACL so only internally is allowed and put DNS in place with internal resolution. Scalable.
1
u/archontwo Oct 27 '25
Option C, but you will have to find a way to update it as for security reasons you cannot have certs that last forever.
I suggest you put a private vpn on every embedded device (wireguard, preferably as it is a 'quiet' protocol) and the schedule a job where you copy the certs as they are updated on your backend service somewhere.
See this.
2
u/megared17 Oct 27 '25
LE certs are only valid for 90 days, so unless you have a way to regularly renew and redeploy that won't work.
Why does something on an isolated/internal network need https anyway?
2
u/ferminolaiz Oct 28 '25
Step-ca is a pretty good option if you want to spin up an internal CA with support for ACME.
2
u/Academic-Gate-5535 Nov 04 '25
Handling ACME/certificate renewals on a device you don't have 100% ability to talk out/recieve back is always going to be a pain.
So just self-sign, with a long expiry. But individual certs on each device
2
u/certkit Nov 06 '25
I agree with many other comments, you probably shouldn't do A or B. "Option D" as described to let the user self-generate one is probably the best if this is an open-source project that people are running on their own.
I want to tell you to use CertKit for centralized management, but that just doesn't fit your use case.
1
u/Alarmed-Arm9276 Nov 07 '25
You can just get a free let's encrypt for free from scratch. Here is the article and code how to do it. https://awheelmaker.com/ACME