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

Feature request: Allow user/custom certificate CA #5

Closed
Skyr opened this issue Jan 31, 2021 · 6 comments · Fixed by #6
Closed

Feature request: Allow user/custom certificate CA #5

Skyr opened this issue Jan 31, 2021 · 6 comments · Fixed by #6

Comments

@Skyr
Copy link

Skyr commented Jan 31, 2021

My DocSpell is reachable via SSL; when trying to upload data, I get an error that the certificate chain is broken. My certificate is issued by a local CA, the certificate is added in the user store.
I think accepting user SSL certificates has to be explicitly enabled in the manifest (at least that's what Google pointed me to). Not everyone is crazy enough to set up his/her own CA, but self-signed certs might be a more common case. So it would be great to have an option to accept a self-made certificate (or its CA).

@eikek
Copy link
Member

eikek commented Jan 31, 2021

I think to "allow" it, one needs to somehow import the ca certificate into androids trust store. I have no idea, how that is done. I'm also fine with accepting ssl connections without verifying the connection. A switch in the app would be nice, of course.

@TheOneValen
Copy link
Contributor

I tried importing it into the store. Other apps like chrome etc. don't complain about my certificate anymore. The docspell app still does, it does not seem to honor the android cert store.

@eikek
Copy link
Member

eikek commented Mar 28, 2021

Thank you @TheOneValen for the update! so, this is my very first android app :-). It is very likely I missed a setting; i'd have thought that the http client lib uses the system trust store…. Have to take a deeper look

@TheOneValen
Copy link
Contributor

TheOneValen commented Mar 28, 2021

I think you will need to allow user added certificates in the android manifest file. That should do the trick.

 res/xml/network_security_config.xml: 

<base-config cleartextTrafficPermitted="true">
    <trust-anchors>
        <certificates src="system" />
        <certificates src="user" />
    </trust-anchors>
</base-config>


https://developer.android.com/training/articles/security-config

This sadly means everybody who installs their own certificates will be nagged in the drawer that the traffic may be snooped upon......

Surely its possible to let the user install a certificate just for this app, but that is definitely much much more work.

@eikek
Copy link
Member

eikek commented Mar 29, 2021

Thank you! So this is even the default for android <= 6.0. I'm going to add this; or if you want to do it, also great :-)

@TheOneValen
Copy link
Contributor

I'll add it within the next few days.

@eikek eikek closed this as completed in #6 Apr 1, 2021
@eikek eikek added this to the Docspell Share 0.5.0 milestone Apr 2, 2021
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

Successfully merging a pull request may close this issue.

3 participants