Unifi Cloud Key: Custom SSL Certificate
Unifi Cloud Key: Custom SSL Certificate
I found this post by Cullum Smith show how to import the wildcard ssl to cloud key, I tested it work for me.
https://www.c0ffee.net/blog/unifi-cloud-key-ssl-certificate
Login SSH
In the instructions below, I'm going to assume you have a certificate pair for example.com, and your Cloud Key is located at cloudkey.example.com. You will also need the root certificate (as well as any intermediate certificates) for your certificate authority concatenated into a single file. The intermediate certificate should be placed before the root certificate. I'm going to assume you named this file chain.crt.
First, copy the certificates to the Cloud Key. The root password should be the same one you use to log into the web interface.
# stop the unifi web service service unifi stop # backup the default certificate mkdir backup cp -r /etc/ssl/private/ backup # remove the default SSL bundle rm /etc/ssl/private/cert.tar # MAGIC - discovered through random forum posts, wailing, and gnashing of teeth. # the password for export is your cound key root password. openssl pkcs12 -export -in example.com.crt -inkey example.com.key -out example.com.p12 -name unifi -CAfile chain.crt -caname root keytool -importkeystore -deststorepass aircontrolenterprise -destkeypass aircontrolenterprise -destkeystore /usr/lib/unifi/data/keystore -srckeystore example.com.p12 -srcstoretype PKCS12 -srcstorepass aircontrolenterprise -alias unifi cp example.com.crt /etc/ssl/private/cloudkey.crt cp example.com.key /etc/ssl/private/cloudkey.key rm /etc/ssl/private/ssl-cert-snakeoil.key chown root:ssl-cert /etc/ssl/private/* chmod 640 /etc/ssl/private/* tar -cvf cert.tar * chown root:ssl-cert cert.tar chmod 640 cert.tar service nginx restart # NOTE: if you have an ECC certificate like me, you must also complete # the following magic incantations. # (if you don't know what an ECC certificate is, just ignore this part.) # # echo "unifi.https.sslEnabledProtocols=TLSv1.2" >> /usr/lib/unifi/data/system.properties # echo "unifi.https.ciphers=TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" >> /usr/lib/unifi/data/system.properties # finally, restart the unifi service service unifi start
Comments
Post a Comment