Securely Expose your Homelab Services with Mutual TLS - YouTube (www.youtube.com)
from possiblylinux127@lemmy.zip to selfhosted@lemmy.world on 20 Jul 05:10
https://lemmy.zip/post/44336058

#selfhosted

threaded - newest

dan@upvote.au on 20 Jul 05:57 next collapse

I haven’t watched the video yet, but it’s generally not worth the hassle of setting up mutual TLS if you’re already using a peer-to-peer VPN like Tailscale, as the VPN software is already doing mutual authentication.

Edit: A peer-to-peer VPN (or mesh VPN) is one where two systems that are connected to the VPN can directly communicate with each other, instead of needing to go through a central server as with something like OpenVPN. With Tailscale or Wireguard, the peers need each other’s public keys to communicate.

antithetical@lemmy.deedium.nl on 20 Jul 09:22 next collapse

This is only true for the connection security. With mTLS you can also authenticate to the webapplication you’re trying to reach. So consider your use-case between vpn/mtls.

dan@upvote.au on 20 Jul 18:22 collapse

Oh yeah that’s a great point I didn’t consider. Thanks.

Netrunner@programming.dev on 20 Jul 15:54 collapse

The whole point of mTLS is that you dont need to use a VPN to achieve that same security.

dan@upvote.au on 20 Jul 18:22 next collapse

I get that, but a lot of people are already using a VPN to access their self-hosted system.

WhyJiffie@sh.itjust.works on 21 Jul 15:24 collapse

that’s not that same security. an observer will still know that you are connecting over HTTPS to a particular doman/IP, maybe they can also deduce that you are using mTLS, and all your other traffic is not protected by it at all. all the while with wireguard, they can see that it’s wireguard traffic, and where it goes, but anything inside is secret, plus if an app uses unencrypted traffic for some reason (smb, dns, custom and special protocols), wireguard will hide and protect that too.

tinsuke@lemmy.world on 20 Jul 06:14 next collapse

Tried it and it was a breeze to set it up with Caddy!

Problem was… lack of client side support, specially on mobile.

Many (most?) client apps don’t support it.

Use the PWA from your browser, you said? I hope you like Google and using Chrome, because Firefox for Android doesn’t support it (mTLS) 😭 (for now, see replies)

antithetical@lemmy.deedium.nl on 20 Jul 09:32 next collapse

I was curious so I looked it up… But it should technically work on FF for Android, although there is a bug in the UI.

See:

tinsuke@lemmy.world on 20 Jul 18:10 collapse

That’s no bug, mTLS just isn’t implemented on Firefox (for Android) currently.

There are 2 proposed solutions on that thread:

  1. It was possible on old versions of FF, but not the current ones. I believe this to be related to the versions prior to the revamp that happened circa 2020. (the author refers to a version that was already “old” by 2022). So it was something supported on OG Firefox, not not on the new (current, by 5 years already) version.
  2. Using the debug menu’s secret settings to enable “Use third party CA certificates”. This is available on current FF, but that’s no mutual TLS. It is about allowing CA certificates that you installed yourself on your device for server TLS auth.
antithetical@lemmy.deedium.nl on 21 Jul 08:40 collapse

How I read it is that they’ve reintroduced it in FF 139 and that you need to enable the third-party certificates to acces the client certificate in the Android cert. store. But the linked bugs in the later replies of my link mention a regression in FF 140+.

I do agree that this is still a horrible UX though. Sadly I don’t have the time currently to test it.

tinsuke@lemmy.world on 21 Jul 11:14 collapse

Oh, you’re right.

It seems to have been implemented and working on 138, but broken since 140 (my current version), with a fix scheduled to come on 142.

I’m looking forward to that one!

MysteriousSophon21@lemmy.world on 20 Jul 17:49 next collapse

The client cert management is the biggest hurdle with mTLS - I’ve found using a YubiKey to store certs makes it wayy more portable across devices, tho still doesn’t solve the mobile app support issue.

dataprolet@lemmy.dbzer0.com on 20 Jul 21:50 collapse

Firefox for Android partially supports PWAs.

tinsuke@lemmy.world on 21 Jul 04:54 collapse

Oh, I meant mutual TLS by “it”. Edited.

Lem453@lemmy.ca on 21 Jul 00:30 next collapse

I didn’t know what this was until now. It seems like the beta bitwarden app supports this. Would be interesting to get it setup for that.

daniskarma@lemmy.dbzer0.com on 21 Jul 06:55 next collapse

I tried long ago, but as they said, client side authentication is an issue, most clients do not support it.

I have a system, I use wireguard vpn and for when I want to use a domain name with proper tls (because some client apps require a proper tls connection to work) I set my caddy reverse proxy to only accept request from localhost local network.

So, there’s a public domain with let’s encrypt TLS, and that domain can only be properly access from local network. Then I connect using vpn to my local network and the client app can access the service over a CA verified TLS.

napkin2020@sh.itjust.works on 21 Jul 09:16 next collapse

I set my caddy reverse proxy to only accept request from localhost.

It is a bit more involved but you can actually get a proper cert for localhost stuff, with your domain pointing to an internal ip addr and not risk exposing your public ip and having to open a port.

daniskarma@lemmy.dbzer0.com on 21 Jul 12:35 collapse

Signed by a AC?

I had a lot of issues with some apps not allowing self-signed certificates and the app used their own list of allowed AC or something, I was unable to make it allow my own certificates even adding my own root certificate to Android.

napkin2020@sh.itjust.works on 21 Jul 13:31 collapse

No, signed by Let’s Encrypt, a proper, real cert. gist.github.com/…/fc04b081ed19910618770c6be998de0…

zqps@sh.itjust.works on 21 Jul 12:19 collapse

From localhost? Did you mean from local network or am I misunderstanding your point here?

daniskarma@lemmy.dbzer0.com on 21 Jul 12:29 collapse

Yes, local network I meant.

napkin2020@sh.itjust.works on 21 Jul 09:17 collapse

mTLS is so cool, until you find out that almost no clients support it.

WhyAUsername_1@lemmy.world on 21 Jul 16:26 collapse

Immich supports it.