Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
view the rest of the comments
I see, thanks for the explanation. Amazon sends the certificate to the proxy, and the proxy sends its own certificate, masquerading as amazon, to the user.
Thanks
I think it's important to understand how a typical SSL certificate is generated. Basically, there are a handful of companies that we have all agreeded to trust. When you download Chrome it comes with a set of trusted root certificates, so does your OS, etc. So when Amazon wants to create an SSL for amazon.com, the only way they can do that is by contacting one of those handful of trusted companies and getting them to issue a certificate that's says Amazon.com. When you go to the site, you see a trusted party generated the cert and your browser is happy.
When you create a new root certificate and install it on your computer, you become one of those companies. So now, you can intercept traffic, decrypt it, read it, reissue a certificate for amazon.com (the same way Amazon would have gotten one from the third parties), reencrypt it, and pass it along to the client. Because the client trusts you it's still a valid certificate. But if you inspect the certificate on the client side the root signer will no longer be GoDaddy or whatever, it will be you.
Basically, if I were to run a CA locally (on my network) and use that certificate in some OS, I should be able to set up a MiTM setup easily. Except that applications like web browsers don't care and will utilise certificate pinning anyway, regardless of which certificates I keep in my certificate store in the OS.
Also, let's say I'm running HAProxy/Caddy/NGINX at home which acts as my SSL-termination point for my network. In this case, if a service wants to access the internet, do these reverse proxies encrypt the outbound traffic with a different certificate?
If I understand the question, the traffic in your local intranet will basically always be encrypted with your root cert. So client -> proxy with your cert, then normal internet encryption from proxy -> internet.
For the apps, it depends on the app, but you can usually insert your cert into their store, it might just be different than the systems store. This could be hard to do on an non-rooted iPhone, idk. My experience is with Linux desktops. For example, in chromium based apps, there is a database in ~/.pki/nssdb that you can insert your cert into. Again, this is something I do at work where we have a very tightly controlled network and application stack. I would not recommend a MiTM proxy for your home environment, it will only cause headaches.
Ah, I see. I suppose I got a bit confused, and wanted to confirm how encryption would work for outbound traffic. Just to be sure: when an application wants to send encrypted data to a website/service on the Internet, it will use the respective certificate for said website. However, if one runs a transparent proxy in the middle and inserts a root certificate in the certificate store of the application, said certificate becomes valid (and the de-facto pick) for all websites, and this is what the client begins to use for everything.
Is that how it works?
Not quite. This might be a better explanation than I'm providing: https://chat.openai.com/share/c77fc7ed-9d68-4076-ab70-e953a3896bb6
Indeed, that is what I meant to say. Thanks for the link. I'm assuming that transparent proxies have some sort of certificate store in them, since they connect as the user to different websites?
Yes, I think that 'masquerading' is the key bit to grasp. The MITM Proxy isn't just intercepting the traffic, it alters the traffic as it passes through.
Thanks, got it!