May 13, 2015

Applying a wildcard SSL certificate to Unifi controller software

Running the Unifi controller software on a Ubuntu machine, and wanted to replace the self-signed certificate with my own wildcard cert. This was surprisingly easy, here are the steps I took...
  1. Download and install  Keystore Explorer from SourceForge on my Windows workstation. 
  2. Keystore Explorer insists on installing unlimited strength jurisdiction policy, but provides straightforward wizard to do this. Run Keystore Explorer as administrator, then follow the prompts to complete the update
  3. Once updated, launch Keystore Explorer and create a new empty keystore. Go to File - New and choose JKS for the type of keystore
  4. From Tools menu choose Import Key Pair - PKCS #12
  5. Click Browse, locate the PFX file for the wildcard certificate
  6. Provide decryption password and click Import
  7. When prompted for a password, enter aircontrolenterprise
  8. Go to File, Save As, and save the keystore file with the name keystore
  9. When prompted, enter the same password for the keystore, aircontrolenterprise
  10.  Using Putty PSFTP, upload the keystore file to a known location on the Unifi controller machine
  11. Oops, I forgot that I didn't have SSH running on the controller, so needed to install that on the Ubuntu machine... sudo apt-get install openssh-server
  12. Now on the Unifi controller machine, need to copy the new keystore file to the correct location. 
  13. Make a backup of the original keystore file just in case...
    sudo cp /var/lib/unifi/keystore /var/lib/unifi/keystore.bak 
  14. Copy the new keystore file I just uploaded to /var/lib/unifi...
    sudo cp ~/keystore /var/lib/unifi
  15. Restart the Unifi controller service, or just reboot the machine, and new certificate is now in place.