ncsms-android icon indicating copy to clipboard operation
ncsms-android copied to clipboard

Error "UNK" whan adding an account

Open JeromeSi opened this issue 7 years ago • 19 comments

Steps to reproduce

1.write URL / Login / Password 2.click Sign in 3.error "UNK"

Expected behaviour

I can't connect the 2.0.1 with my nextcoud Nextcloud SMS 1.2.4 work fine

Actual behaviour

I have the message error "UNK" when i try to add an account

Server configuration

Nextcloud version: 11.0.6

PHP version: 5.6.33

Webserver: apache2

HTTPS: 2.4.10

Client configuration

Android version: 8.0.0 or 6.0 or 7.1.2

Phone: XZ1 compact / emulated / Moto G 4G peregrine

Nextcloud SMS app version: 2.0.1

Logs

E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae477d00 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae477f80 I/fr.unix_experience.owncloud_sms.activities.LoginActivity.UserLoginTask: _serverURL = https://192.168.1.253:4433 I/GoLog: Get https://192.168.1.253:4433/index.php/apps/ocsms/get/apiversion?format=json: x509: cannot validate certificate for 192.168.1.253 because it doesn't contain any IP SANs D/EGL_emulation: eglMakeCurrent: 0xaa9efe40: ver 2 0 (tinfo 0xafead090) D/EGL_emulation: eglMakeCurrent: 0xaa9efe40: ver 2 0 (tinfo 0xafead090) D/EGL_emulation: eglMakeCurrent: 0xaa9efe40: ver 2 0 (tinfo 0xafead090) D/EGL_emulation: eglMakeCurrent: 0xaa9efe40: ver 2 0 (tinfo 0xafead090) D/EGL_emulation: eglMakeCurrent: 0xaa9efe40: ver 2 0 (tinfo 0xafead090) D/EGL_emulation: eglMakeCurrent: 0xaa9efe40: ver 2 0 (tinfo 0xafead090) D/EGL_emulation: eglMakeCurrent: 0xaa9efe40: ver 2 0 (tinfo 0xafead090) E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae476e00 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae477d00 capture

JeromeSi avatar Feb 12 '18 17:02 JeromeSi

@JeromeSi interesting error, at least you give me the golang error it's fine

nerzhul avatar Feb 12 '18 20:02 nerzhul

It seems it can be due to your local certificate. Seems java client accept it but not the golang http client which is stricter. I'm looking for a workaround to permit it in insecure configurations

Your certificate doesn't have any IP:192.168.1.253 field

nerzhul avatar Feb 12 '18 20:02 nerzhul

In this log, you find the golang error... I'm learning about it. The certificate are self signed (it's my own little server)

JeromeSi avatar Feb 12 '18 20:02 JeromeSi

@JeromeSi i'm trying to reproduce the problem

nerzhul avatar Feb 12 '18 20:02 nerzhul

can you give me the public certificate of your server by mail (contact at unix-experience.fr) i will analyse the SSL issue on it

nerzhul avatar Feb 12 '18 20:02 nerzhul

wait a minute

JeromeSi avatar Feb 12 '18 20:02 JeromeSi

For your usecase with SSL, regenerate a proper certificate with proper SANs (IP/DNS names)

First generate the following openssl.cnf file

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req

[req_distinguished_name]
countryName = Country Name (2 letter code)
countryName_default = US
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = MN
localityName = Locality Name (eg, city)
localityName_default = Minneapolis
organizationalUnitName  = Organizational Unit Name (eg, section)
organizationalUnitName_default  = Domain Control Validated
commonName = Internet Widgits Ltd
commonName_max  = 64

[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = kb.example.com
DNS.2 = helpdesk.example.org
DNS.3 = systems.example.net
IP.1 = 192.168.1.1
IP.2 = 192.168.69.14

Replace DNS entries with yours if you have it, and IP with yours. (if you have 3 IPs, add IP.3 = A.B.C.D)

Next regenerate a private key

openssl genrsa -out nextcloud.key 2048

And generate a signing request

openssl req -new -out nextcloud.csr -key nextcloud.key -config openssl.cnf

Last generate the certificate

openssl x509 -req -days 3650 -in nextcloud.csr -signkey nextcloud.key -out nextcloud.crt -extfile openssl.cnf -extensions v3_req

If all succeed, verify the certificate with the following command

openssl x509 -in nextcloud.crt -text

You must have the following entry: X509v3 Subject Alternative Name:, containing your IPs or DNS names

If it's good, replace certificates of your nextcloud/owncloud instance

nerzhul avatar Feb 12 '18 21:02 nerzhul

I've got new certificate... a space missing in "openssl req -new -out nextcloud.csr -key nextcloud.key -config openssl.cnf"

JeromeSi avatar Feb 12 '18 21:02 JeromeSi

i also just released 2.0.2 to show the SSL issue properly in android

nerzhul avatar Feb 12 '18 21:02 nerzhul

mmh. I replace my old certificate by new in my configuration, I reboot my server and no access to my owncloud...

JeromeSi avatar Feb 12 '18 22:02 JeromeSi

Just check your apache/nginx logs it should show you a SSL issue on the startup i think, maybe you inverted key and cert

nerzhul avatar Feb 12 '18 22:02 nerzhul

ok. You're right. I've got the same error...but I've got the 2.0.1 version

JeromeSi avatar Feb 12 '18 22:02 JeromeSi

I don't know the line command to update my git repository on my hard disk...I'm searching

JeromeSi avatar Feb 12 '18 22:02 JeromeSi

Different issue but error capture du 2018-02-12 23-34-00 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xaa284b20 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xaa284580 I/fr.unix_experience.owncloud_sms.activities.LoginActivity.UserLoginTask: _serverURL = https://192.168.1.253:4433 I/GoLog: Get https://192.168.1.253:4433/index.php/apps/ocsms/get/apiversion?format=json: x509: certificate signed by unknown authority D/EGL_emulation: eglMakeCurrent: 0xaa2ef960: ver 2 0 (tinfo 0xaaa5e700) D/EGL_emulation: eglMakeCurrent: 0xaa2ef960: ver 2 0 (tinfo 0xaaa5e700) D/EGL_emulation: eglMakeCurrent: 0xaa2ef960: ver 2 0 (tinfo 0xaaa5e700) D/EGL_emulation: eglMakeCurrent: 0xaa2ef960: ver 2 0 (tinfo 0xaaa5e700) I'm going to sleep

JeromeSi avatar Feb 12 '18 22:02 JeromeSi

at least 2.0.2 really permits to show the certificate error, i should look at this issue asap but i'm tired :)

nerzhul avatar Feb 12 '18 22:02 nerzhul

With app 2.02 on emulated device android 6.0 When I select add an account, I have got this error in logcat : 02-13 19:20:11.396 2875-2911/fr.unix_experience.owncloud_sms E/Surface: getSlotFromBufferLocked: unknown buffer: 0x9f2c3f20 After write server address, login and password, the app crash

JeromeSi avatar Feb 13 '18 18:02 JeromeSi

But "work" (don't crash when click o Sign in) on other emulated device Classical error : 02-13 19:32:33.119 3428-4638/fr.unix_experience.owncloud_sms I/GoLog: Get https://192.168.1.253:4433/index.php/apps/ocsms/get/apiversion?format=json: x509: certificate signed by unknown authority

JeromeSi avatar Feb 13 '18 18:02 JeromeSi

I'm getting same error as JeromeSi for unknown authority. Is it possible to add option to ignore this issue. Other apps (eg, Davdroid, Nextcloud) don't complaining about the certificate.

livingsacrifice avatar Apr 06 '18 19:04 livingsacrifice

Can you not add the option to allow less secure certs? Like foldersync

hackitz avatar May 17 '18 23:05 hackitz