nextcloud / passman-android

:key: Android app for Passman.
https://passman.cc
GNU General Public License v3.0
93 stars 30 forks source link

Error on Android 9: net:ERR_CLEARTEXT_NOT_PERMITTED #66

Closed mwaeckerlin closed 5 years ago

mwaeckerlin commented 5 years ago

Unfortunately, the Android app does not work in Android 9 (Huawei P30 Pro):

When trying to login, I get the error message:

Website nicht verfügbar

Die Webseite unter http://my.nextcloud.url/index.php/login/flow/grant?clientidentifier=&stateToken=s0mEteXtAndNumbers konnte nicht geladen werden, weil

net:ERR_CLEARTEXT_NOT_PERMITTED

(In English: Website not available, could not be loaded due to…)

Please note, that I entered https://my.nextcloud.url, not http://my.nextcloud.url, but in the error message, the URL is wrong, without s.

Exactly this problem is mentioned here: https://stackoverflow.com/questions/52707918/webview-showing-err-cleartext-not-permitted-although-site-is-https And here: https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted

The solution seems to be, to add to the application tag:

<application
  …
  android:usesCleartextTraffic="true"
  …>

Could you please fix this problem? Thank you in advance.

mwaeckerlin commented 5 years ago

I found and fixed the problem, it was on server site: curl -v showed me, that https://my.nextcloud.url is redirected to http://my.nextcloud.url/index.php/login.

The following occ command on the server fixes the problem, as discussed here:

sudo -Hu www-data ./occ config:system:set overwriteprotocol --value https

I use my docker image mwaeckerlin/nextcloud, where I simply forgot to set the protocol. It is now fixed.

Sorry for the wrong issue, but hopefully it helps others with the same problem.