I wished dealing with HTTPS on localhost was less painful. Like, couldn't the OS have a special built-in trusted cert which apps can use?

Last edited Oct 20, 2024 · 7:52 PM UTC

152
83
2,412
300,688
Oh wow, this seems to have struck a nerve. Thx for all the great replies! I don't have a SoundCloud, but if you look for managed Apache Flink and realtime ETL, check out what we build at @Decodableco! Be excellent to each other ✌️.
Wow, thanks a lot for all the replies, that's what I love this place for! As I've learned, both mkcert (github.com/FiloSottile/mkcer…) and Caddy (caddyserver.com/docs/quick-s…) automate the process of registering a local CA, giving you certificates (or HTTPS proxy) to work with.
2
1
36
16,182
Sort replies: Relevant Recent Liked
Replying to @gunnarmorling
Brew install mkcert and create a wildcard domain cert locally? Not tried this but hoping it will work (assuming you’re on macOS).
2
34
14,202
Ended up with Caddy as a proxy for now. Like mkcert, it registers a local CA.
3
35
13,091
Replying to @gunnarmorling
Try caddy 😊
2
32
15,849
Interesting, how does it help with that?
3
3
15,320
Replying to @gunnarmorling
1 - cr we te your won CA 2 - import into your browser 3 - create a CSR for local host 4 - sign it with your new CA 5 - set up the certificate and private key with your test server.
1
10
11,304
I know, I know :) But it's quite a way from there to "something I just don't need to deal with".
1
20
9,349
Replying to @gunnarmorling
Why HTTP isn’t good enough for localhost?
6
6
9,206
In my case it's the Rust object-store crate which refuses plain HTTP, so I needed to set up HTTPS for MinIO running locally.
3
17
7,947
Replying to @gunnarmorling
Letsencrypt is literally free
1
2
5,449
Yeah, but it doesn't work for localhost.
2
22
4,745
Replying to @gunnarmorling
You'll love what my graduate colleagues at BYU developed: secure socket APIs for OS kernels. usenix.org/system/files/logi… But until then, I made user-space @caddyserver a good solution for this.
16
3,851
Replying to @gunnarmorling
Why use https on localhost?
4
4
2,616
Replying to @gunnarmorling
Once upon a time, I bought the domain localcode.net, pointed it to 127.0.0.1, and generated certs using LetsEncrypt to help me with this. I still own it.
1
7
1,610
Replying to @gunnarmorling
@LocalCanApp does that without needing to touch the terminal. Also .local domains are visible on the whole local network.
1,430
Replying to @gunnarmorling
Herd handles this automatically
1
566
Replying to @gunnarmorling
+1 for caddy
72
Replying to @gunnarmorling
Can easily be done with @Tailscale, where each machine can get a HTTPS certificate automatically: tailscale.com/kb/1153/enabli…
28
5,229
Replying to @gunnarmorling
Honestly localhost should just be some kind of semi hardcoded exception in browsers
2
25
3,124
Replying to @gunnarmorling
I have a cname that points all *.domain.com requests to 127.0.0.1 — then I run a single instance of @traefik to handle HTTPS termination using letsencrypt. It routed the requested hostname to the container via a label on the container. Once it’s setup it’s pretty painless and kind of a “set and forget” type setup.
1
1
15
6,322