m3gA schreef op dinsdag 12 december 2017 @ 15:19:
Ik heb een bestaand (Comodo) certificaat voor een webserver. op het zelfde externe ip heb ik een UniFi controller (Cloud Key). Ik heb een SAN (alternative name) voor de UniFi controller unifi.domeinnaam.nl
Nu wil ik het bestaande self signed certificate vervangen door het Comodo certificaat. Ik heb net wat blogs/community nagespit maar er zijn zo veel verschillende guides (in variatie van complexiteit). Weet iemand wat de juiste/beste manier is?
Ik wil de CloudKey niet verpesten met gehobby en geprobeer.
Zelf heb ik ook een comodo certificate op mijn Cloud Key geinstalleerd. Heb er een kennisartikel voor Unifi voor geschreven (even geen zin om te vertalen)
(In jouw geval hoef je de CSR niet meer te doen, aangezien je al een cert hebt. De keys moet je natuurlijk nog wel importeren)
Dit installeert het certificaat voor de cloudkey en controller en de configuratie blijft staan na een update van de controller.
Login to the Cloud Key using SSH:
*Make a backup of the folder /etc/ssl/private to your local PC
code:
1
2
3
4
5
| sudo su
cd /etc/ssl/private
rm -f /etc/ssl/private/*
openssl genrsa -out /etc/ssl/private/cloudkey.key 2048 |
(Pas onderstaande aan met je eigen gegevens)
code:
1
| openssl req -new -batch -subj "/C=<Country ISO Notation>/ST=<State>/L=<City>/O=<Organisation>/OU=UniFi/CN=<website URL>/emailAddress=<mail address>" -key /etc/ssl/private/cloudkey.key -out /etc/ssl/private/cloudkey.csr |
*Copy the cloudkey.csr to your local PC in the same folder of the backup you made.
*Do a certificate request at your CA of choice
*Save the received certificate (incl. the intermediate and CA certificate) to your local PC in the same folder of the backup you made.
*Download and install KeyStore Explorer
*Run KeyStore Explorer and open unifi.keystore.jks from the backup folder (password = aircontrolenterprise)

Click on Tools > Import Key Pair

Select OpenSSL > click on Ok

Deselect Encrypted Private Key
Select the cloudkey.key file from the backup folder
Select the certificate file that you received from your CA from the backup folder
Click on Import

Enter unifi as alias and click on Ok

Confirm with Yes

Use : aircontrolenterprise : as password

Click on OK
Click on Tools > Import trusted certificate

Import all intermediate and CA certificates
The Result:
Click on File > Save
Copy all contents except the cert.tar file to the /etc/ssl/private/ folder on the Cloud Key
Give the following commands on the SSH Console:
code:
1
2
3
4
5
6
7
| tar -cvf cert.tar *
chown root:ssl-cert /etc/ssl/private/*
chmod 640 /etc/ssl/private/*
nginx -t
/etc/init.d/nginx restart ; /etc/init.d/unifi restart |
[
Voor 2% gewijzigd door
Luppie op 12-12-2017 20:35
. Reden: Opmaak aangepast ]
Heb je iets aan mijn antwoord ? Een thumbs-up wordt zeker op prijs gesteld.