Install certificates on an Unifi controller

Install certificates on an Unifi controller

What you need is the following

  • Debian with SSH enabled and sudo permissions
  • Unifi Controller installed
  • Valid certificates (yourCertificate.cert, yourPrivateKey.key, yourCA.crt)
  • Winscp
  • Putty

How to

  1. Open WinSCP and connect to your Unifi controller
  2. Upload your certs (yourCertificate.cert, yourPrivateKey.key, yourCA.crt) to your home folder
  3. Logon to your Unifi controller via SSH
  4. Run the following command to convert your certificate to a PKCS12
    sudo openssl pkcs12 -export -in yourCertificate.cert -inkey yourPrivateKey.key -out yourNewCertName.p12 -name unifi -CAfile "yourCA.crt" -caname root -password pass:aircontrolenterprise
  5. Copy your newly converted PKCS12 certificate
    sudo cp yourNewCertName.p12 /etc/ssl/private/
  6. Bind your newly copied PKCS12 certificate to the Unifi services
    sudo keytool -importkeystore -deststorepass aircontrolenterprise -destkeypass aircontrolenterprise -destkeystore /usr/lib/unifi/data/keystore -srckeystore /etc/ssl/private/yourNewCertName.p12 -srcstoretype PKCS12 -srcstorepass aircontrolenterprise -alias unifi
  7. Restart the Unifi services (or reboot your server)
    sudo /etc/init.d/unifi restart

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *