vSphere 6 – Zertifikat austauschen

Mit vSphere 6 bietet vMware eine eigene Zertifikatsstelle (vmcad) für seine Produkte an. Wer aber dennoch lieber eigene Zertifikate verwenden möchte kann dies natürlich auch weiterhin tun.
Zertifikat Request erstellen:

C:\Program Files\VMware\vCenter Server\vmcad>certificate-manager
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
| |
| *** Welcome to the vSphere 6.0 Certificate Manager *** |
| |
| -- Select Operation -- |
| |
| 1. Replace Machine SSL certificate with Custom Certificate |
| |
| 2. Replace VMCA Root certificate with Custom Signing |
| Certificate and replace all Certificates |
| |
| 3. Replace Machine SSL certificate with VMCA Certificate |
| |
| 4. Regenerate a new VMCA Root Certificate and |
| replace all certificates |
| |
| 5. Replace Solution user certificates with |
| Custom Certificate |
| |
| 6. Replace Solution user certificates with VMCA certificates |
| |
| 7. Revert last performed operation by re-publishing old |
| certificates |
| |
| 8. Reset all Certificates |
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
Note : Use Ctrl-Z and hit Enter to exit.
Option[1 to 8]: 1
Please provide valid SSO password to perform certificate operations.
Password:
1. Generate Certificate Signing Request(s) and Key(s) for Machine SSL certificate
2. Import custom certificate(s) and key(s) to replace existing Machine SSL certificate
Option [1 or 2]: 1
Please provide a directory location to write the CSR(s) and PrivateKey(s) to:
Output directory path: c:\tmp\6
2015-03-22T14:25:31.824Z Running command: ['C:\\Program Files\\VMware\\vCenter Server\\vmcad\\certool.exe', '--genkey', '--privkey', 'c:\\tmp\\6\\machine_ssl.key', '--pubkey', 'c:\\users\\admin\\appdata\\local\\temp\\2\\pubkey.pub']
2015-03-22T14:25:32.064Z Done running command
2015-03-22T14:25:32.067Z Running command: ['C:\\Program Files\\VMware\\vCenter Server\\vmcad\\certool.exe', '--gencsrfromcert', '--privkey', 'c:\\tmp\\6\\machine_ssl.key', '--cert', 'c:\\users\\admin\\appdata\\local\\temp\\2\\vecs_crt.crt', '--csrfile', 'c:\\tmp\\6\\machine_ssl.csr']
2015-03-22T14:25:32.116Z Done running command
CSR generated at: c:\tmp\6\machine_ssl.csr

Anschließend diesen Request von seiner Zertifikatsstelle signieren und das Zertifikat im Base64 Format wieder auf dem Server zur Verfügung stellen.
Dann kann dieses jetzt importiert werden:

1. Continue to importing Custom certificate(s) and key(s) for Machine SSL certificate
2. Exit certificate-manager
Option [1 or 2]: 1
Please provide valid custom certificate for Machine SSL.
File : c:\tmp\6\machine_ssl.cer
Please provide valid custom key for Machine SSL.
File : c:\tmp\6\machine_ssl.key
Please provide the signing certificate of the Machine SSL certificate
File : c:\tmp\6\root-base64.cer
You are going to replace Machine SSL cert using custom cert
Continue operation : Option[Y/N] ? : y
Status : 100% Completed [All tasks completed successfully]

Alternativ kann man auch mit Hilfe des Windos-Zertifikatsdienst ein Zertifikat anfordern, austellen lassen und exportieren:


Das Zertifikat als .pfx (mit Private Key’s) exportieren und anschließend per OpenSSL für vMware konvertieren.
Key exportieren:

openssl pkcs12 -in 123.pfx -nocerts -out key.pem -nodes
Enter Import Password:
MAC verified OK

Zertifikat exportieren:

openssl pkcs12 -in 123.pfx -nokeys -out cert.pem
Enter Import Password:
MAC verified OK

Passwort vom Key entfernen:

openssl rsa -in key.pem -out server.key
writing RSA key

Die beiden Dateien (cert.pem & server.key) könnt ihr anschließend über den Certificate-Manager importieren.

5 Gedanken zu „vSphere 6 – Zertifikat austauschen“

  1. Hey Constey,
    Vielen Dank für die Anleitung.
    Das hat mir geholfen mein Problem auf den richtigen Weg zu bringen.
    Wie bist du darauf gekommen, dass die Zertifikate im BASE64 Format sein müssen ??
    Gruss
    Thomas

    Antworten
  2. Hallo,
    wenn man ein Zertifikat mit Hilfe des Windows-Zertifikatsdiensts anfordert und über OpenSSL konvertiert, erhält man ja die beiden genannten Dateien cert.pem & server.key. Beim Importvorgang des Certificate-Managers werdn jedoch drei Dateien verlangt:
    „Please provide the signing certificate of the Machine SSL certificate“
    Welche Datei wird hier benötigt?
    Grüße
    Kevin

    Antworten

Schreibe einen Kommentar zu Thomas Antworten abbrechen

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.