In my new Unifi network I'm running the Unifi Controller in a Docker container on my Synology NAS, see here.The only thing missing is a proper certificate for it, let's fix that.
I already have a Let's Encrypt certificate installed that I am going to re-use. Goto
Control panel choose
Security and export the curent certificte:
This will give you a zip file to download. Unzip the files in the archive and upload them back to the Synlogy to the Docker mapped folder:
Now from the Synology Docker UI open the Unifi container and create a new Terminal with
/bin/bash as the command:
Now, in this terminal issue these two commands:
openssl pkcs12 -export -in cert.pem -inkey privkey.pem -out unifi.p12 -name unifi -CAfile fullchain.pem -caname root
keytool -importkeystore -deststorepass aircontrolenterprise -destkeypass aircontrolenterprise -destkeystore /var/lib/unifi/keystore -srckeystore unifi.p12 -srcstoretype PKCS12 -alias unifi
Now stop and start the container and presto, you have the Let's Encrypt certificate applied on your Unifi Controller running in Docker on your Synology.
Got to love it.