Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are self-signed certificates supported? #30

Open
pimlie opened this issue Mar 20, 2024 · 4 comments
Open

Are self-signed certificates supported? #30

pimlie opened this issue Mar 20, 2024 · 4 comments

Comments

@pimlie
Copy link
Contributor

pimlie commented Mar 20, 2024

The readme says:

You must configure TLS with a reverse proxy in front of MollySocket. Molly can only connect to the server over HTTPS.

But should self-signed certificates be supported? Cause it seems they are not.

Im using caddy's tls internal option as my server is not publicly accessible and in my browser I get a response {"mollysocket":{"version":"1.2.0"}} after having confirmed the security warning about the self-signed certificate.

But in molly I keep getting the error MollySocket server not found. After enabling debug logs in caddy I see the following error logged:

DBG ts=n.n logger=http.stdlib msg=http: TLS handshake error from x.x.x.x:yyyy: remote error: tls: unknown certificate

So I guess that's because molly doesn't trust the self-signed certificate? Is there any way to resolve this, preferably without having to install caddy's self-created CA root on my phone?

@p1gp1g
Copy link
Member

p1gp1g commented Mar 20, 2024

Allowing cleartext requests or self-signed certificates requires to change the networking configuration of molly, which is something we want to avoid.

You should try getting a signed certificate with certbot (Let's Encrypt), it is pretty simple

@pimlie
Copy link
Contributor Author

pimlie commented Mar 21, 2024

Thanks for the quick reply. I hate to ask you this but as I just cannot find anything on how to do this, could you please give some pointers on how to create a letsencrypt certificate for a private server/ip that's not publicly available?

Eg do you mean to use a wildcard certificate with DNS validation? Or to somehow proxy acme challenge requests? Cause on this page https://letsencrypt.org/docs/certificates-for-localhost/ it seems letsencrypt also suggests it's not possible to use them for a private host. See also this section https://letsencrypt.org/docs/allow-port-80/, the issue is that on this server ports 80 & 443 are just not publicly accessible.

which is something we want to avoid.

I guess that makes sense, is it also because the network client in molly is used for both communication with the signal servers as mollysocket? So if molly f.e. would have an option to manually add a trusted certificate key then that certificate key could potentially also be used to intercept traffic to the signal servers? And it would be too much work to create separate network client instances for requests respectively from molly to signal and from molly to the unifiedpush endpoint?

@p1gp1g
Copy link
Member

p1gp1g commented Mar 23, 2024

Well, it may be possible to allow self-signed. Allowing clear text is different since you have to set cleartextTrafficPermitted to true for the all app.

For the certificate, you can use a wildcard certificate (with DNS challenge). Some domain registrars provide one with a domain too. You can also use a tcp tunneling application, or expose an empty HTTP server for the ACME challenge.

@jwjenkin
Copy link

jwjenkin commented Apr 8, 2024

I'll be that guy and ask for self-signed to be allowed 🙂granted, it would have to be an "advanced" option, but I sign all my bits locally around my network, most of which is only accessible via a wireguard connection that is on when I leave the network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants