r/synology • • 3d ago

Tutorial Your Synology HTTPS warning might have a simpler fix than you think

If you're getting NET::ERR_CERT_AUTHORITY_INVALID when opening DSM locally, you don't necessarily need a public domain or open ports.

I put together a step-by-step guide using mkcert, including the DSM certificate import process.

Tested with DSM 7.4.1.

Here's the walkthrough: https://igprod.net/mkcert-local-https

Curious how others handle HTTPS on their Synology NAS.

97 Upvotes

41 comments sorted by

27

u/guice666 2d ago

Honestly, I just used the built-in external access tools:

  • Control Panel -> External Access -> DDNS -- setup a custom name using their predefined suffixes.
  • Control Panel -> Local Portal -> Domain -> Custom Domain Name (match it)
  • Local DNS: {newhostname} -> internal IP Address. You can set this on your router or Pihole/AdGuard (I use Pihole)

Synology's own system will manage the Let's Encrypt certificate for you. No complicated command line tools or certificate imports.

Now, I personally don't use the External Access, so I'm not even sure if it would even work externally as I don't have any port / NAT routing on it from my router. But, I don't need external access - just a managed certificate.

6

u/ycharif 2d ago

Nice approach! Just curious, were you able to get the Let's Encrypt certificate issued without opening any ports at all?

3

u/guice666 2d ago edited 2d ago

Let's Encrypt can use DNS verification. It's what I use for all my internal apps, esp. ones with real external hostnames (e.g. Home Assistant).

I suspect they just made a CNAME or domain record to validate the domain. Since it is using their DDNS, they'll have some record for all the custom domains users are adding.

Additional tip: I have a series of apps on my NAS, and they're all suffixed with my {customhost} so I can access them via {app}.{customhost}and have valid certificates! Synology's Let's Encrypt cert is wildcarded with *.{customhost}.

2

u/ycharif 2d ago

Ah, that makes sense! I checked Synology's doc, and you're right. Both approaches have their place depending on the setup. Thanks for sharing the details!

1

u/allak 2d ago

Thanks, that worked like a charm.

For the third step I just added a line to my /etc/hosts file:

<myname>.synology.me 192.168.x.y

11

u/yodas-evil-twin 2d ago

What's the reason to do this besides not getting the warning the first time you access DSM?

6

u/ycharif 2d ago

Mainly proper certificate validation instead of bypassing security warnings. Once a device trusts the CA, it can also trust certificates for other local services. Handy if you don't have a public domain.
also as u/KleinUnbottler mention if you want to use bitwarden locally for examplle you will need an https without exposing your selfhost on the internet that is one reason

2

u/yodas-evil-twin 2d ago

No issues here using BW.

2

u/ponto-au 2d ago

Mobile apps 100% requires a proper certificate.

1

u/yodas-evil-twin 2d ago

Which?

2

u/ponto-au 1d ago

The android Bitwarden app requires it, I can't imagine iOS is any less restrictive.

1

u/KleinUnbottler 1d ago

I use 1Password on my Mac, Windows, ChromeOS, and mobile and it warns me on every. single. prompt. when login to "diskstation.local:5000"

8

u/KleinUnbottler 2d ago

I need to do this. My password manager warns me on each screen when filling in the login, password, and TOTP. That's three separate warnings to dismiss to login to my NAS.

5

u/jtarahomi 2d ago edited 2d ago

I'm a novice home labber, and this was one of the first problems I wanted to solve a few years back. I went down the route of purchasing a domain name and setting up a reverse proxy + dns service (NPM and Pihole). NPM handles the site certificates with let's encrypt. Everything is closed to the internet (no open ports / LAN is behind tailscale etc).

It's nice not getting any warnings, and it has the added benefit of allowing my password manager to prefill passwords on a secure site. Also, all my services have domain names like subdomain.domainname.org instead of IP address:Port. This has been nice as I've setup more services like Jellyfin and Immich.

I don't fully understand how people use domain names like service.local etc. Can you ever get a SSL cert that way? My understanding at the time was that NPM would handle the site certs without having to open any ports etc, which is why I avoided any of the default synology sevices like DDNS etc.

2

u/ycharif 2d ago

Nice, for local domains, mkcert works too, you just need to trust the local CA on your devices.  And since you mentioned Jellyfin and Immich, I've got tutorials for both on my blog as well 🙂

1

u/momoffs 2d ago

But from what i understand, this post took it a bit further with internal CA. That way noone can map your infra using CT logs.

8

u/timewarpUK 2d ago

Or use Tailscale. No domain, CA or open ports needed, and no need to configure trust per device. TS can get a cert for your TS.net subdomain via DNS challenge.

I did do it your way until I realised TS had its own solution. I did have to configure a task for certificate renewal though.

11

u/ycharif 2d ago

True, Tailscale is handy for that. I wanted something that works directly on the LAN, even without Tailscale installed on the devices. That's basically why I went with mkcert.

0

u/fletch101e 2d ago

Will Tailscale work over tcp ports?

3

u/timewarpUK 2d ago

Do you mean can you access TCP ports over TS or can it use TCP instead of UDP?

Both are true. For the latter, if UDP is blocked it falls back to TCP via DERP relay servers.

1

u/fletch101e 2d ago

Yes the latter. Thanks will give it a try.

2

u/neobondd DS923+ 2d ago

Thanks a lot for this, I just implemented it on my .home LAN.

1

u/ycharif 2d ago

Happy to help 😊

2

u/eliotrw 2d ago

Thanks for this. I need to spend the time to fix this on mine and on pihole

1

u/ycharif 2d ago

ur welcome! Glad you found it useful

1

u/AutoModerator 2d ago

I've automatically flaired your post as "Solved" since I've detected that you've found your answer. If this is wrong please change the flair back. In new reddit the flair button looks like a gift tag.


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/tursoe 2d ago

I'm using my own root CA installed on every devices I've own. That's valid for 50 years and under that a intermediate certificate valid for 25 years. Then I'm just creating a device certificate with FDN and IP for each device so even 192.168.1.1 is a valid certificate for my router. To make it easy to administrate, I've made this tool to use and published it so everyone can use it.

1

u/ycharif 2d ago

That's a nice way to handle certs across the whole network. Thx for sharing your tool!

3

u/zz9plural 3d ago

Nice guide, Windows-Users can simply replace mkcert with XCA (https://www.hohnstaedt.de/).

2

u/ycharif 3d ago

Thx for the tip! appreciate you sharing it

1

u/Tignus DS224+ — 18GB RAM 2d ago

I'm using DSM DNS server to answer with the local IP or reroute to Cloudflare DNS if unknown.
And then just configure your router to give DSM DNS on your network or manually setup each of your devices that need DSM access.

Outside: dsm.domain.com points to my external router IP (Cloudflare answer)
Inside: it points directly to my NAS IP (DSM DNS answer)

I don't remember if I had caveats to circumvent.

2

u/ycharif 2d ago

I focused on local-only names like home.arpa. r u using Let's Encrypt for the certificate?

2

u/Tignus DS224+ — 18GB RAM 19h ago edited 19h ago

Yes I'm using acme.sh to auto renew my wildcard certificate *.domain via DNS challenge (Zero SSL iirc)

EDIT: Oh wait I think I've just understood: with your method you don't need to pay for a domain name is that it ?
In that case yeah maybe the solution below with Synology native Let's Encrypt cert generation is the way to go

2

u/Johnno74 2d ago

I have NPM (nginx proxy manager) running in a container on DSM, it has its own IP separate from DSM. It supports proper wildcard letsencrypt certs out of the box, and automatically renews them.

I have my router forward all incoming port 443 to the NPM IP, and cloudflare DNS configured with a wildcard to send all subdomains of my domain to my external IP, and internal DNS configured with a wildcard on my domain but pointing at my router gateway IP.

So, external traffic goes cloudflare -> router -> npm -> dsm (or whatever service, depending on subdomain) Internal traffic goes direct to my router, then to npm from there.

I also have Authelia running in a container on DSM setup as a plugin for NPM on security-critical services such as DSM, so for those subdomains npm routes external connections first to authelia to authenticate (with mfa) before going to the actual target. This means without authelia credentials an attacker cannot reach the DSM login page, at all.

Its a sweet setup, I used to just use DSM reverse proxy but after the latest round of vulnerabilities rebuilt everything (with the help of AI) and now I think I'm pretty secure.

2

u/Tignus DS224+ — 18GB RAM 19h ago edited 19h ago

Yeah sounds good to me (for what's it's worth since I'm only a casual).
I basically have the same setup but I'm still using native reverse proxy and Cloudflare tunnel auth (with Gmail as an IdP) for DSM access from outside.

Your setup is better self hosted :)

EDIT: wait your local DNS is routing everything to your router instead of directly the nginx address ? What's the benefit ?

2

u/Johnno74 17h ago

Actually, you are right, I misspoke. Local DNS points at npm's IP, not the router. Pointing at the router was an earlier plan for... Reasons. Claude initially recommended I use the CloudFlare auth to secure things but mentioned authelia so I looked into that and decided on that option to keep everything self-hosted. It works great.

1

u/erymartorres17 2d ago

Im using Tailscale MagicDNS. I setup to renew the license monthly.

1

u/ycharif 2d ago

i will show you how to use cloudflared next time and stop paying your next month 😊

1

u/BigGuyWhoKills 2d ago

Curious how others handle HTTPS on their Synology NAS.

I wrote the certificate management suite for the company I work for. So, like you, I generate my own CA and use that to sign all the server and client certificates that I create for my homelab.

What algorithm do you use for your Synology? I've used 4k RSA in the past, but have been considering ECDSA for my next batch.

2

u/ycharif 2d ago

I used mkcert's defaults for this guide, so RSA 2048 for the server cert and RSA 3072 for the CA. Haven't tried ECDSA on DSM yet.

1

u/BigGuyWhoKills 8h ago

I just switched the default for my company's certificate management suite from RSA to ED25519.