Android app error: "Strict mode, no HTTP connection allowed!"

Nextcloud version (eg, 20.0.5): 22.2.0.2
Operating system and version (eg, Ubuntu 20.04): Docker, Ubuntu 20 on WSL
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 7.4

The issue you are facing:
Attempting to login with the android mobile app returns error “Strict mode, no HTTP connection allowed!” By both email/pass and Google SSO. I am able to login via web UI and webdav on the same device.

Is this the first time you’ve seen this error? (Y/N): Y, first time app user

Steps to replicate it:

  1. Fresh install Nextcloud server
  2. Fresh install android app
  3. Log in

The output of your Nextcloud log in Admin > Logging:
No server log errors

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => '*',
  'passwordsalt' => '*',
  'secret' => '*',
  'trusted_domains' => 
  array (
	3 => '*',
	0 => 'localhost',
	1 => '192.168.*.*',
	2 => '172.16.0.0/12',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '22.2.0.2',
  'overwrite.cli.url' => 'http://localhost:8080',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'VzLP6UGH6fqJ2',
  'installed' => true,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);

as first hint - you should never post you passwords please remove the passwords from you post and change all exposed passwords!

It looks you have HSTS header configured which enforce https but your instance is running on http… from the config you show I have no idea how it could happen (BTW: how do you access “localhost:8080” with android app?)

Whoops, missed that password, thanks. No worries, it’s on an internal-only docker network. I’ll change it after this issue is resolved.

It looks you have HSTS header configured

How do you see that? And I did have HSTS configured on my server some time back, but it was removed before I started trying to install nextcloud. Hold on.

Just tried on another android phone, and it’s having the same issue. However, an iPhone is logging in fine on the app. Also, I’m trying to access an SSL address, so I’m not sure why HSTS would be throwing a fit either way.

Just realised QR code login does work, BTW.

(BTW: how do you access “localhost:8080” with android app?)

I’m not, I’m accessing my domain name.

this results in all URI within you instance a build based on http://localhost:8080 which prevents access to the server from clients and brakes TLS and switch to plain http… I’m really surprised you are able to login and do something…

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=overwrite%20cli%20url

maybe you want to review you reverse proxy config

Oh ok. Everything has worked so far except the android client login. The docs say it only affects cronjobs and occ, so perhaps android login just happens to overlap with that somehow. Thanks.

Had the same issue recently, I use a reverse proxy and SSL cert.
Setting ‘overwriteprotocol’ => ‘https’, allowed me login with Android client without any errors.

4 Likes

Hello,

Thanks for pointing out the solution.

Yes, adding that line manually in NextCloud configuration file allows me to get rid of that warning and log in via the android app.

For information, I am using NextCloud Snap behind a reverse proxy running Nginx Reverse Proxy Manager.

Thanks.