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

Sync with self-hosted sync server: Flatpak Certificate issue // Feature port from Android app #3749

Open
overcuriousity opened this issue Jan 19, 2025 · 4 comments

Comments

@overcuriousity
Copy link

I am running a self-hosted sync server.
This sync server is available on a local domain (e.g. anki.domain.internal) which is encrypted with a self-signed TLS certificate, signed by a self-signed root Certificate.

This is generally working across all my network, but not with the anki app. As I discovered by flatpak/flatpak#2721, this is a matter of properly calling a parameter during flatpak packaging to use the system trust anchor.

The anki Android app has another approach which might also work, providing an input field where the root cert can be supplied manually.

@iamllama
Copy link
Contributor

@voczi would you happen to already have an addon that lets someone pass a cert to set_custom_certificate?

Since it's already integrated into anki, we might as well expose it in sync settings, but then again, the "anki is too complex" faction might get angry 😅, hence my bringing it up as an addon first

@overcuriousity
Copy link
Author

overcuriousity commented Jan 22, 2025

Its actually only a matter to package it correctly in flatpak to properly use the network configurations available on the system.

Setting a different certificate or even installing an addon for that purpose should not be necessary and is just a workaround in that scope.

@iamllama
Copy link
Contributor

Might be best to bring this up in https://github.com/flathub/net.ankiweb.Anki in that case

Still, feature parity with ankidroid and making it more convenient for folks to switch to self-hosting seem like plusses 🙂

@voczi
Copy link
Contributor

voczi commented Jan 22, 2025

@voczi would you happen to already have an addon that lets someone pass a cert to set_custom_certificate?

Nope, but you could just do:

from aqt import mw
mw.backend.set_custom_certificate("your cert")

So it shouldn't be that hard to make an addon from this.

Its actually only a matter to package it correctly in flatpak to properly use the network configurations available on the system.

It would probably be up to the maintainers of the Anki Flatpak to do this as llama said. But perhaps setting the SSL_CERT_FILE environment variable can serve as a workaround for now:
rustls/rustls-native-certs#32
#2324 (comment)

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

No branches or pull requests

3 participants