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:
- Setup your 1st device by creating an account.
You need to provide:
- server URL
- Connect a 2nd device (this is where magic happens):
- Select "Pair a device" on the 2nd device
- Firefox tells you to enter a code on your 1st device
- Enter the code
- 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!