5 ms·
Why can't someone make TLS self-configuring?? I want to just run a server somewhere (my laptop, kubernetes, some virtual machine) and have any domain which poi
by londons_explore 6y ago
Why can't someone make TLS self-configuring??
I want to just run a server somewhere (my laptop, kubernetes, some virtual machine) and have any domain which points to that VM auto-create a TLS certificate.
I challenge anyone to propose a way to register and set up "mydomain.com" (https serving some static files) with opensource software without having to type "mydomain" at least 3 times!
- francislavoie 6y agoThat's exactly what Caddy does! https://caddyserver.com https://caddyserver.com
- jsjsbdkj 6y agoACME HTTP challenges (Let's Encrypt, for example) literally do this. Your web server gets a challenge from the issuer, serves a special page with the response to validate that you own the domain, and the issuer gives you a cert for that domain.
- londons_explore 6y agoBut it turns out no server I have seen is as simple as "apt install server". You always have to paste in 100 lines of boilerplate into some hidden config file.
- francislavoie 6y agoLike I replied in a sibling thread, Caddy can do exactly this. A few lines to install the debian repo (with systemd service): https://caddyserver.com/docs/install#debian-ubuntu-raspbian https://caddyserver.com/docs/install#debian-ubuntu-raspbian Then your /etc/caddy/Caddyfile just looks like this (assuming you have an app listening on port 8080 that you want to proxy to): example.com reverse_proxy localhost:8080 Yer done. Automatic HTTPS for "example.com", all you need to do is point your DNS to your server, make sure ports 80 and 443 are accessible, and Caddy does the rest.
- fjni 6y agoThis blew my mind: https://pkg.go.dev/golang.org/x/crypto/acme/autocert https://pkg.go.dev/golang.org/x/crypto/acme/autocert
- makeworld 6y agoHere's one that's actually ready to use: https://github.com/caddyserver/certmagic https://github.com/caddyserver/certmagic
- tialaramex 6y agoAs illustrated by several of the replies, people can do this, particularly using the ACME standard. In fact it's slightly surprising to me that many more web server applications don't do this yet, I had sort of expected that Microsoft for example would ship an IIS that just magically works, maybe supplied out of box with a coupon for one certificate per Windows Server license or something from a for-profit Certificate Authority, and maybe then you either change a registry value to use Let's Encrypt or you pay them $10 per cert for the out-of-box behaviour. Or that services that are intended to run as a web server, like Jenkins or Bugzilla would do all this for you. But you won't be able to solve the general problem without some other element. The current iteration of the Ten Blessed Methods makes it very easy to have an HTTP or HTTPS server that arranges for its own certificates with ACME, because they assume that if you get to run web servers (on port 80 and/or 443) on some.name.example that's because you control some.name.example or you've got permission from whoever does control it to do whatever you want. It's trickier for a mail server. You may genuinely run the MX for some.name.example but if you don't control DNS for that name, nor run the web servers, you can't pass ACME challenges. In the case of a mail server you could automate a hypothetical ACME challenge that relies on say 3.2.2.4.4 Constructed Email to Domain Contact but I don't think anybody actually offers that today. It's completely impossible (today, on your own) for some other random TLS service. If you run the TLS-enabled IRC server on some.name.example you can't get certificates without help from the person who really controls the some.name.example FQDN. They need to either let you run an HTTP server, control their DNS records or just hand out working certificates to you somehow.
- benlivengood 6y agoCert-manager works with at least Ambassador to do this, but basically any web server that can read a tls certificate from a Kubernetes secret should work with cert-manager. Beyond that, though, there really isn't a solid "turn on TLS" option because security is hard and TLS is not a panacea. It ostensibly encourages that a client on the Internet will only send data to a domain name that currently has a matching TLS certificate (practically relying on an intricate web of trust between DNS and PKI), but that isn't even a guarantee. Web servers often still listen on port 80, clients can be forced to ignore certificate errors, and TLS does zero client-side authentication or authorization by default.
- GauntletWizard 6y agoI am working towards this goal, sort of: I believe that TLS should be self-configuring. I've built a spec and some tools around automatically issuing TLS certificates automatically in a well-defined place in Kubernetes clusters. You then call my init code to start up your services - Exactly like you'd call http.ListenAndServe(), you call KubeTLS.ListenAndServe(). The code is simple enough, and there's a little script you run on your development machine to create a self-signed cert locally. https://gitlab.com/gauntletwizard_net/kubetls https://gitlab.com/gauntletwizard_net/kubetls