Can't sync Contacts and Calendar


I installed Cozy on a Raspberry Pi 2 B and everything seems to run smoothly except syncing my contacts and calendar to my iPhone.

I followed the guides and double checked for typing errors, but I keep getting an authentication error.

Can you help me?


Hi @rasmussvane

we are sorry that you encounter some issues with your iPhone Sync. Here some tips to try to find a solution:

  • is the sync app installed and running on your Cozy?
  • on your iPhone, the Port should be set to 443 (which is not the default port) and SSL enabled
  • for the calendar, iOS is setted to only sync last month events by default, which may creates somn inconsistencies when you have recurring events which starts before one month ago. Don’t hesitate to it to sync all events

Hope it can help you :smile:


Hi @m4dz.

Thanks you for your reply.

The app is running, the port is set to 443 and SSL is enabled.

When trying to add the account I get an error message saying (translated from danish): “Not able to connect using SSL - Would you like to try without SSL?”.

Are there some magic SSL thing I might need to do or configure?


Hi @rasmussvane,

Are you using a valid certificate on your server, or a self-signed one ? If you use a self signed certificate, your phone will probably refuse to connect to your server, and I encourage you to try to get a valid cert from Let’s encrypt.


I am not sure :smile:

I just followed the installation guide as good as I could.

What is best and do you have something I could search for to help me?

Again - Thank you for your time


Hello @rasmussvane,

A cozy user wrote a tutorial to get a LE certificate for your cozy: A Let's Encrypt certificate for your Cozy / Un certificat Let's Encrypt pour votre Cozy



If you followed this installation guide, your certificate is self signed and won’t be accepted by every browser / device. So it’s better to get a free and valid certificate from Let’s encrypt. Here’s an “how tow” we wrote.

I’m gonna update our installation guide to explain this, thanks for reporting :smile:


Thanks @rouky and @Clochix.

I will try it out later tonight and let you know :smile:

Have a nice day,


Nice, seems we found the poblem :smile:

@rasmussvane, before trying to get a valid certificate from LE, you can go to https://<you-cozy-server-address> from Safari on your iPhone. It’ll pop a message informing you your certificate isn’t valid. Click on details and accept (top right corner) to install the certificate on your iPhone. Then try to sync your *davs accounts again. It may solves your issue :wink: .


I couldn’t get Safari to as for the certificate :expressionless: But Thanks for the suggestion


Updates in Certificate Gate.

Following the guide to get a certificate for my RP2 ends up crashing things so I had to reinstall everything twice :smile:

It fails when I get to this part:

/root/letsencrypt/letsencrypt-auto certonly \
    --standalone --agree-tos \
    --email -d \
    --standalone-supported-challenges tls-sni-01

It gives me the following error:
Failed to connect to host for DVSNI challenge

And when trying to start nginx I get:
[…] Starting nginx (via systemctl): nginx.serviceJob for nginx.service failed. See ‘systemctl status nginx.service’ and ‘journalctl -xn’ for details.

Not sure what is going on, but I will keep trying for a bit.


Hi @rasmussvane,

Just to be sure…

For getting a certificate from Let’s Encrypt, your server need to have a fully qualified domain name, and be accessible from the network.
For example, if you assign to your RPI2, the server must really be reachable from anywhere using this domain name.
If you want to sync your phone with your server, you’ll need such a domain name.


Hi @Clochix.

My domain points to the RPI2 and I can access it externally just fine.

Could I go through the Let’s Encrypt tutorial on another machine and then transfer the Certificate to the Pi?

For some reason everything breakes when I try to generate it on the Pi.


Looks like a problem specific to Let’s encrypt on your RPi2 :-S
Yes, you can point the domain name to another server, generate the certificate on it then copy it to your Raspberry.
But be warned that Let’s encrypt certificates expire every 3 month, so you’ll have to repeat this hack to renew the cert.


Running Let’s Encrypt on a seperate linux machine gives me the same error - Can’t connect to server.

Typing the given domain into any browser, both on my internal network and from an external, gets me to the correct and working IP.

Do I need to do anything specific if I can reach the server this way?


I think Let’s encrypt needs to access to server both on port 80 and 443. Are both of them opened?

This doesn’t seem to be a Cozy related problem, I can hardly help you more, sorry :-S


Port 80 wasn’t open, but now it is. Still not working. On OS X it saids that the username or password couldn’t be confirmed.

But thanks a lot. I greatly appreciate your help!


Hello @rasmussvane,

The --standalone-supported-challenges tls-sni-01 in

/root/letsencrypt/letsencrypt-auto certonly \ --standalone --agree-tos \ --email -d \ --standalone-supported-challenges tls-sni-01

states that Let’s Encrypt is going to contact the HTTPS ports. You can change it to --standalone-supported-challenges http-01 for Let’s Encrypt to contact the HTTP port that you have opened.


Hi @rouky.

Thank you for your suggestion!

When I run the command I am told to stop the processes using port 80 and 443, but when I stop nginx Let’s Encrypt have no way of connecting to the server.

Should I halt the server in some special way to keep it open but not listening to the ports?


Hi @rasmussvane,

Any news ? I think that when you run the Let’s encrypt client in stadalone mode, it use its own web server wich listen on port 80 and / or 443.