Hey all!

I have a bunch of services running on my home server and was looking to expose some of them publicly via Cloudflare tunnel. This is done and working great using the origin server certificate and strict TLS.

Up until now, I’ve been using self-signed certs internally but now I don’t want to deal with the “proceed anyway” crap on browsers. I have Traefik set up to get certs from Cloudflare using DNS challenge and that seems to be working.

So, now my problem is: how do I switch between these certificates for the same URL when I’m internal vs public? I’d rather keep that traffic local if I’m at home, which is also working, I just can’t figure out how to get Traefik to use the appropriate certificate depending on if the request is coming from my LAN or Cloudflare.

Any suggestions? Is there a better way to accomplish what I want to do?

EDIT: Looks like I’m just going full Cloudflare on this one, thanks for your help everyone!

  • IHawkMike@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 months ago

    You said Traefik is getting certs from Cloudflare, but do you mean it’s getting Let’s Encrypt certs using a CF DNS challenge? And if that is the case, then your browser should trust the Traefik endpoint since LE certs are publicly trusted.

    Are you sure you’re hitting Traefik when you get a cert warning? You need to update your internal DNS if not.