Howto: Firefox OS + Calendar + Raspberry Pi + ownCloud + Self-Signed SSL Certificate

I’ve been experimenting with ownCloud on my Raspberry Pi as an alternative to Google (for contact and calendar sync) and Dropbox (for file sync). Because of the contrained resources of the Raspberry Pi this setup doesn’t exactly fly like a rocket, but it works, so far, and I’m happy to have my sync repository on my desk as opposed to in a murky bunker in place unknown.

I installed the stock Raspbian image and then followed the steps in this helpful guide to get Nginx, PHP and ownCloud running on the Pi. It worked without issue; the only thing I diverged from is that I installed ownCloud six instead of the version 5 mentioned there.

Part of the helpful guide involves creating a self-signed SSL certificate to allow traffic to and from the Pi to be encrypted. Setting up OS X Calendar sync with this certificate in place didn’t present a problem: I simply agreed to trust the certificate. Same thing in my iPad.

On Firefox OS, however, there’s no such option, and when I tried to add my ownCloud calendar as a Caldav account I got an unhelpful generic error message. Looking at the output of adb logcat as this failed I saw the cause was, indeed, SSL related:

The certificate is not trusted because it is self-signed.

Fortunately there’s another helpful guide that walked me through the process of adding a new root certificate to my Firefox OS device. A few notes on that process:

  1. I didn’t have the Mozilla NSS certutil binary on my Mac, and there didn’t seem to be a non-complicated way of compiling and installing it, so I did all the certificate-mangling work on an EC2 host where it was pre-installed.
  2. In the text where it says “<CAName>”, you simply make up a name for your personal “certificate authority,” like “Reinvented” or “PeteCo”.
  3. The references to “<CAFile>” are to the cert.pem file you generated on your Raspberry Pi.

Otherwise, the process went exactly as advertised, and once I restarted the Firefox OS device (and this was a necessary step), I was able to add my ownCloud Caldav server to the Calendar app without issue, and after a brief pause for sync my calendar showed up:

My ownCloud calendar on my Firefox OS device Calendar app

 

Comments

Ton Zijlstra's picture
Ton Zijlstra on September 10, 2016 - 12:58 Permalink

With Letsencrypt it should now be possible to easily get a trusted cert. Esp as Mozilla is trusting the Letsencrypt rootcert now. Currently attempting to get nextcloud on my R Pi that way.