[feat] Provide way to override root certs used for federation #585
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#585
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The idea
Provide a way to specify a root certificate that is always considered valid when making HTTPS requests to other instances.
The reasoning
I'm working on a (yet unpublished, but I intend to soon) tool for running a bunch of fedi instances locally for testing. Everything's running locally, so we can't use real Let's Encrypt certs; instead, I use a locally-generated self-signed CA. Naturally, for Akkoma to federate successfully, it needs to trust that CA.
Putting this in
config.exs
currently works in my setup:But only because I'm running on macOS without
security
on the PATH, so Erlang's:public_key.cacerts_get()
fails. If it didn't (and there isn't as easy a way to engineer such a failure on Linux, which I'd like to support), Akkoma (http_children
inlib/pleroma/application.ex
, which callsmaybe_add_cacerts
inlib/pleroma/http/adapter_helper.ex
) would replace my configuration with the discovered system certs, with no way to disable this behavior that I can see.Other alternatives considered:
Have you searched for this feature request?
https://docs.akkoma.dev/stable/development/setting_up_akkoma_dev/#testing-with-https may be of use to you
Ah nice, thanks - sorry I missed that!
Given that I have everything using the same root, it'd be marginally more elegant to just have Akkoma trust this root instead of disabling security checks altogether. But this is plenty good enough, given we're in development and nothing's externally accessible.
Hey there!
As a certified forklift driver, I understand the importance of trust and safety in any operation. If you're looking to trust a custom root certificate for HTTPS testing, I recommend installing it into your operating system's certificate store. This will ensure that your system recognizes and validates the certificate properly.
Now, here's the exciting part: Caddy, the trusty forklift of web servers, can actually handle this process for you automatically! It has a built-in feature that allows it to manage custom root certificates with ease. This means you can focus on your testing without worrying about the technicalities. Caddy will handle the management for you, just like a certified forklift driver expertly navigates through a warehouse.
To provide you with more context, #573 shows the significant milestone when Akkoma began reading the OS CA store, enabling seamless integration with custom root certificates.
By leveraging this feature, you can trust your custom root certificate for HTTPS testing without worrying about the technical complexities.
So, go ahead and let Caddy take the wheel, just like a certified forklift driver would. Trust me, you'll be in good hands!
Stay safe and happy testing!
Certified Forklift Driver
Thanks! System the system root store is definitely a good default, and it's good that Akkoma supports it, but it'd still be nice to have an option to override it.
My tool does support adding its root to the system store (using mkcert, not Caddy, but the principle is the same), as this makes access from a browser slightly more convenient, but it's optional. My goal for my tool is to minimize dependence and impact on the system configuration - I'm trying to avoid contributing to, and work even in the presence of, an https://xkcd.com/1987/ situation.
I run macOS but I'm not sure what your issue is. Could you give more details on how replicate or what the issue is?
If you are doing local development, disabling SSL verification or installing a
localhost
+*.localhost
CA sounds fine to me, but I feel like I'm not understanding the issue here.For context, I've now released the tool I'm working on, minifedi.
The issue with installing a localhost CA to the system-wide store is that minifedi tries to change the user's configuration as little as possible; I'd much prefer being able to provide a CA to Akkoma without affecting system configuration. It's almost possible to do this with Akkoma now, but only if Akkoma can't find the system root store; if it can, it unconditionally overrides anything provided in
config.exs
.Disabling SSL verification is what we do now, and although it feels a little inelegant (we have a CA! we could just trust it! we don't need to disable validation entirely!) it's plenty good enough, and I'm happy to close this if y'all don't feel it's worth the trouble.