Fun with Firefox Sync

Ever since I setup my own "Firefox Sync Server" (a.k.a.: Weave) I've been puzzled by how a new device figures out the location of the Sync Server. A short reminder of the steps involved:

  1. Setup your 1st device by creating an account.
    You need to provide:
    1. email
    2. password
    3. server URL
    Pretty standard stuff.
  2. Connect a 2nd device (this is where magic happens):
    1. Select "Pair a device" on the 2nd device
    2. Firefox tells you to enter a code on your 1st device
    3. Enter the code
    4. ???
    5. Your 2nd device is now sync'ing!

Notice how the 2nd device was never told the URL of the custom sync server? Wtf!

I just assumed that there was a "dispatch" server URL from Mozilla hardcoded in Firefox that routes new devices to current ones somehow, and I (reluctantly) moved on.

I tend to obsess over things I don't fully understand, however, and finally looked into it in more details today. I launched Wireshark and re-setup one of my machine. This is where I found that a connection to http://auth.services.mozilla.com/ is made during setup. A quick search for this address on the Interwebs revealed that it's a "Sync Key Exchange Server".

I then searched for that URL in about:config and found that there is a preference in there called services.sync.jpake.serverURL which points to it.

Now, of course, my plan is to setup my own Sync Key Exchange Server and change services.sync.jpake.serverURL so that it points to it.

Stay tuned to know how that went!

2 Responses to “Fun with Firefox Sync”

Leave a Reply