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

[Bug] Network Request Failed #381

Closed
marco-studer-srf opened this issue Sep 9, 2024 · 14 comments
Closed

[Bug] Network Request Failed #381

marco-studer-srf opened this issue Sep 9, 2024 · 14 comments
Labels
question Further information is requested

Comments

@marco-studer-srf
Copy link

I cannot log in using the mobile app. URL is correct.

Could it be that you cannot handle passwords with ridiculous length and number of special characters?

Screenshot_20240909_094304_Hoarder App

@MohamedBassem
Copy link
Collaborator

No this is unlikely to be a password issue. This is usually the server address being unreachable from the phone or incorrectly setup (e.g invalid certs).
Can you tell us if you're using http/https, is Hoarder behind a reverse proxy? Any special setup there?

@marco-studer-srf
Copy link
Author

The server is behind traefik reverse proxy. The server is using https with a self-signed certificate. The root certificate is added as CA on the phone. Could this be a problem?

@hubono
Copy link

hubono commented Sep 9, 2024

Hi
I'm having the same issue. I installed hoarder on oracle free tier. All went ok.
I installed the app on Android and it's working good.
Now I installed on iphone, made a new user thought the web browser on the iphone, inputted the same details on the app and i get network request failed. I tried on the wifi and 5g, both fail. Im using http

@CrypticC3s4r
Copy link
Contributor

Having the same issue with Android,
It is behind a nginx reverse proxy.

Extension access and Direct Access are functioning well, just mobile makes the problem.

@MohamedBassem
Copy link
Collaborator

I'll release a hoarder mobile update soon that hopefully can help us debug those network connection issues and show exactly the kind of errors that are being reported.

@MohamedBassem MohamedBassem added the question Further information is requested label Sep 14, 2024
@MohamedBassem
Copy link
Collaborator

I've sent (3452e47) to add a new "Test connection" page to debug server connection issue. I hope this help figure out why the app is not working for you. I've submitted this to apple/google for review, should hopefully be available for download by Monday.

@marco-studer-srf
Copy link
Author

Running connection test ...
Using address: https://xxx
Network connection failed: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Okay, it seems to be the certificate. However, I added the certificates to the root certificates of the phone. Accessing Hoarder via browser on the phone is working.

@MohamedBassem
Copy link
Collaborator

@marco-studer-srf Glad to see the new connection debugging thing being useful! Let's change the issue title to be about self signed certs then. I'll check if there's any configuration I need to pass to the app manifest so that it can pick up all of your trusted certs (most likely over the weekend).

@chrishoage
Copy link

I am experiencing this issue using http - I get the same error

Network connection failed: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Except that I'm using http specifically, and the debug output indicates this.

Is the app trying to upgrade to an https connection?

If so - then I'm hitting the same self signed cert error - however I do not wish to add this cert to the root certificates of my phone.

Can there be an option to allow self signed certs?

@marco-studer-srf
Copy link
Author

@MohamedBassem In one of my own projects, I happened to face the same issue. Adding the following network security config to the application makes it accept user-added CAs. It also allows cleartext traffic (http), since self-hosters will usually go one of these two ways.

In res/xml/network_security_config.xml:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
            <certificates src="user" /> <!-- this is the part that makes it work -->
        </trust-anchors>
    </base-config>
</network-security-config>

And in your manifest, add:

android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"

@Raizel-thebloodstorm
Copy link

Bro where to add what ...please explain a little more

@MohamedBassem
Copy link
Collaborator

@Raizel-thebloodstorm this is going to be fixed in the next mobile app release. You won't be able to fix it yourself.

@Ciucci666
Copy link

I had the same problem, i solved it just by adding the https:// and then it worked

@jnskender
Copy link

I had the same problem, i solved it just by adding the https:// and then it worked

Also fixed my issue.

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

No branches or pull requests

8 participants