Can't connnect android device to Local Cozy cloud


#1

hi,

I have setup my Cozy cloud locally on my Pi 3. And the problem is I can’t connect to it using Cozy app on android.
I have tried using CAdroid to get the certificate but it gives me an error :
“The certificate chain doesn’t contain a valid certificate for the host name in the URL. Use the correct host name or change the corresponding certificate’s subject”
I also tried getting a certificate while opening the cozy cloud in and from Firefox browsers and installed it but still can’t connect to the cloud.


#2

Hi @sanshu, welcome aboard :smile:

Looks like you’re using an invalid self-signed certificate. You created a certificate, but it’s name doesn’t match the domain name of your server. If you can’t use Let’s encrypt, you at least need to create a self-signed cert valid for your host, and import it into CADroid.


#3

@Clochix

Yes I can’t use Let’s encrypt. Can you please tell me how to create a valid certificate or share link. Also, since local domains like cozy.local are not working can I create certificate with Local IPs.

Please don’t ask to google it. I already created cozy cloud twice because of creating certificates and messing up things.


#4

Hi, can you tell what you mean with :
“Also, since local domains like cozy.local are not working” ?

I think https://cozy is available (on pi2 at least) instead of cozy.local


#5

To create a self-signed certificate for domain cozy.foo, you can use cozy_management generate_certificate cozy.foo. Then update your Nginx config to use this certificate.


#6

Oh god at last.

@Clochix I think you should stop suggesting CAdroid and instead ask user to use firefox to get the certificates and then installing it.

Also, they can use local ip


#7

Is there a way to install a certificate on Android by using Firefox ? I’m not aware of it (I’m not an Android user)


#8

well That doesn’t have anything to using Android.

all you have to do is open Firefox on your PC and open your Cozy cloud. Be it your Local IP or Domain.
Click on security icon left to address bar.
1.Click on arrow
2. click more information
3. View Certificate
4. Click details tab and press export
5. Then export it to your pc and then android device. then install it.

Also, it is a lot better than that CAdroid which gives a lot of times errors.


#9

Thanks for the tip, I didn’t know you can import a certificate this way on Andrid, without using CADroid.


#10

I have the same problem.
I have created a self-signed certificate (using How to regenerate the certificate?) using “cozy.local” as CN, but CAdroid said:
Unable to resolve host "cozy.local": No address associated with hostname

After some from the irc, I tried to create certificates using the ip as CN. Then CAdroid displays the reported error

name in the URL. Use the correct host name or change the corresponding 
certificate's subject```

Then I created certificate containing the ```CN=cozy.local``` and also the ```subjectAltName=ip:xxx.xxx.xxx.xxx``` but the same error came up by CAdroid

Am I missing something here ?

#11

Hello @alexxtasi,

Sorry, I won’t be able to answer :confused:
Now, the recommended way to go is to use Let’s Encrypt to create a certificate valid in most browsers ans OS.

Maybe could you try to check you certificate by using openssl s_client -connect cozy.local:443 The error message may help you understand what’s wrong with your self-signed certificate.


#12

hey sanshu Am facing the same problem. Hope anyone here can help me too.
Thanks in advance. Regards,


#13

Hello @jasonsmith,

welcome aboard!

This thread was about the old, now deprecated, version of Cozy. Are you using the old Cozy or the new one, Go based?