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

Backend doesnt use android system ca store #121

Open
fyra opened this issue May 20, 2022 · 2 comments
Open

Backend doesnt use android system ca store #121

fyra opened this issue May 20, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@fyra
Copy link

fyra commented May 20, 2022

My Piwigo instance is only accessible locally, so initially I tried setting up the server with a self signed cert after that didn't work (can only add a ca certificates as trusted in android)
I set up a private CA, and adding it to the system ca store, now my piwigo instance works over SSL in browsers on the android device but the piwigo-ng app throws this errror:

Login Fail
HandshakeException: Handshake error in client (OS error: CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(handshake.cc:393))

I even made an intermediate ca to test

$ openssl s_client -connect elec.fyra:8443 -CAfile root.ca.fyra.crt 
CONNECTED(00000003)
depth=2 CN = root.ca.fyra
verify return:1
depth=1 CN = intermediate.ca.fyra
verify return:1
depth=0 CN = server.fyra
verify return:1
---
Certificate chain
 0 s:CN = server.fyra
   i:CN = intermediate.ca.fyra
 1 s:CN = intermediate.ca.fyra
   i:CN = root.ca.fyra
 2 s:CN = root.ca.fyra
   i:CN = root.ca.fyra

[...]

    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: yes
---


After a bit of searching the underlying issue I've found is that flutter/dart doesn't use the android system ca store flutter/flutter#41781

@remi-martin remi-martin added the bug Something isn't working label May 23, 2022
@remi-martin
Copy link
Collaborator

Hi, thanks for your workaround.
This might be related to #74.
We know there are several issues with self hosted Piwigos.

@fyra
Copy link
Author

fyra commented May 23, 2022

Hi, thanks for your workaround. This might be related to #74. We know there are several issues with self hosted Piwigos.

To be clear, my attempt at working around the issue did not pan out. At the moment i havent been able to test the app beyond the login screen.

(Plain http support would be great for local-only self hosted instances, but I gather Android is clamping down on that making things complicated)

It'll spit out essentially the same error with an in-house CA as with a plain old self-signed cert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants