To resolve this issue when using the Platform Services Controller UI to replace the certificates, run the ls_update_certs.py script on the Platform Services Controller. When you run the script, you pass in the old certificate and the new certificate.
You can retrieve the old certificate using the Managed Object Browser (MOB) or from the backup store. Backup store contents changes after each certificate replacement operation; using the MOB is a more reliable option.
You can now extract the thumbprint from this file.
You can extract the thumbprint from the command line or by using a certificate viewer tool. After you extract the certificate, you can upload it to the Platform Services Controller.
- Log in to the External Platform Services Controller Appliance via SSH.
- Run this command to enable access to the Bash shell:
shell.set --enabled true
- Enter shell and press Enter.
- Run this command to get the thumbprint:
openssl x509 -in /certificates/old_machine.crt -noout -sha1 -fingerprint
You see output similar to:
SHA1 Fingerprint=13:1E:60:93:E4:E6:59:31:55:##:##:##:##:##:##:##:##:##:##:##
The thumbprint, is the sequence of numbers and letters that follow the equal sign.
Extracting the Thumbprint from the Command Line on a Windows Installation
- Make a remote desktop connection to the External Platform Services Controller.
- Open an administrative command prompt.
- Run this command to get the thumbprint:
"%VMWARE_OPENSSL_BIN%" x509 -in c:\certificates\old_machine.crt -noout -sha1 -fingerprint
You see output similar to:
SHA1 Fingerprint=13:1E:60:93:E4:E6:59:31:55:##:##:##:##:##:##:##:##:##:##:##
The thumbprint is the sequence of numbers and letters that follow the equal sign.
Extracting the Thumbprint Using a Certificate Viewer Tool You can extract the thumbprint by performing these steps:
- Open the file with a certificate viewer tool. In Windows, double-click the file to open it in Windows Certificate Viewer.
- Get the SHA1 Thumbprint string. In Windows Certificate Viewer, select the SHA1 Thumbprint field.
- Copy the thumbprint string into a text editor and replace the spaces with colons.
Note: With some text editors, invisible characters are added at the beginning. Delete the first character of the thumbprint and any associated spaces, then type, not paste, the character.
Proceed to Task 3 to retrieve the new certificate.
Task 3: Retrieving the New Certificate
If you did not archive the new certificate, you can retrieve it using vecs-cli:
Retrieving the New Certificate on the vCenter Server Appliance
- Log in to the vCenter Server system through console or and SSH session.
- Run this command to enable access to the Bash shell:
shell.set --enabled true
- Type shell and press Enter.
- Run this command to view the new certificate:
/usr/lib/vmware-vmafd/bin/vecs-cli entry list --store MACHINE_SSL_CERT
- Export the certificate to a file with this command:
/usr/lib/vmware-vmafd/bin/vecs-cli entry getcert --store MACHINE_SSL_CERT --alias __MACHINE_CERT --output /certificates/new_machine.crt
Retrieving the New Certificate on the vCenter Server on Windows Installation
- Make a remote desktop connection to the vCenter Server system.
- Open an administrative command prompt.
- Run this command to view the new certificate:
"%VMWARE_CIS_HOME%"\vmafdd\vecs-cli entry list --store MACHINE_SSL_CERT --text |more
- Export the certificate to a file with this command:
"%VMWARE_CIS_HOME%"\vmafdd\vecs-cli entry getcert --store MACHINE_SSL_CERT --alias __MACHINE_CERT --output c:\certificates\new_machine.crt
- Move or upload the certificate to the Platform Services controller via WinSCP or another SCP client.
Proceed to Task 4 to execute the script with the information you gathered in Task 1-3
Task 4: Running the ls_update_certs.py Script
Run the ls_update_certs.py script on the Platform Services Controller after replacing the vCenter Server certificate. To successfully run the script, you must have both the thumbprint of the old vCenter Server certificate and the new vCenter Server certificate.
Warning: You cannot undo the actions of this script. Perform a backup or a snapshot of the virtual machine so you can recover if problems result.
Note: On Windows systems, enclose the password in double quotes.
Running ls_update_cert on the Appliance
The ls_update_certs script is located at /usr/lib/vmidentity/tools/scripts/ls_update_certs.py.
- Log in to the External Platform Services Controller Appliance through console or an SSH session.
- Run this command to enable access the Bash shell:
shell.set --enabled true
- Enter shell and press Enter.
- Change directories to /usr/lib/vmidentity/tools/scripts/ with the following command:
cd /usr/lib/vmidentity/tools/scripts/
- Run this command:
python ls_update_certs.py --url Lookup_Service_FQDN_of_Platform_Services_Controller --fingerprint Old_Certificate_Fingerprint_from_Task_2 --certfile New_Certificate_Path_from_Task_3 --user [email protected] --password 'Password'
For example (do not copy the fingerprint used in this example):
python ls_update_certs.py --url https://psc.vmware.com/lookupservice/sdk --fingerprint 13:1E:60:93:E4:E6:59:31:55:##:##:##:##:##:##:##:##:##:##:## --certfile /certificates/new_machine.crt --user [email protected] --password 'Password'
Running ls_update_cert on a Platform Services Controller Windows Installation
- Connect to the External Platform Services Controller with a Remote Desktop session and administrator permissions.
- Open an administrative command prompt.
- Change directories to C:\Program Files\VMware\vCenter Server\VMware Identity Services\lstool\scripts\ with this command:
cd C:\Program Files\VMware\vCenter Server\VMware Identity Services\lstool\scripts\
- Run this command:
"%VMWARE_PYTHON_BIN%" ls_update_certs.py --url Lookup_Service_FQDN_of_Platform_Services_Controller --fingerprint Old_Certificate_Fingerprint_from_Task_2 --certfile New_Certificate_Path_from_Task_3 --user Username --password Password
For example (do not copy the fingerprint used in this example):
"%VMWARE_PYTHON_BIN%" ls_update_certs.py --url https://psc.vmware.com/lookupservice/sdk --fingerprint 13:1E:60:93:E4:E6:59:31:55:##:##:##:##:##:##:##:##:##:##:## --certfile c:\certificates\new_machine.crt --user [email protected] --password <Password?
Additional Information
Syntax for ls_update_cert
Run the script using the following syntax:
python ls_update_certs.py --url LS_URL --fingerprint OLD_CERT_SHA1_HASH --certfile NEW_CERT_PEM_FILEPATH --user USER --password PASSWORD
LS_URL |
Lookup service URL. On the External Platform Services controller, use the following URL as a model: https://external_platform_services_controller_FQDN.example.com/lookupservice/sdk |
OLD_CERT_SHA1_HASH |
Thumbprint of the certificate that vCenter Server or Platform Services Controller used before certificate replacement acquired in Task 2.
First you retrieve the old certificate:
- If possible, download the current certificate from the vCenter Server system before you perform certificate replacement. For more information, see How to download and install vCenter Server root certificates to avoid Web Browser certificate warnings (330833).
- Otherwise, you can follow the process in Task 1: Retrieving the Old Certificate from the Managed Object Brower
- If you only performed one certificate replacement operation, you can instead use the process in Retrieving the Old Certificate from the Managed Object Brower, listed under Additional Information.
Then you extract the thumbprint from the old certificate.
Note: VMware does not recommends to find the old vCenter Server certificate in the filesystem.
|
NEW_CERT_PEM_FILEPATH |
PEM encoded file of the new vCenter Server machine SSL certificate acquired in Task 3.
Use the file that you just passed in as part of certificate replacement. If you no longer have that file, use the process in Retrieving the New Certificate.
Note: Attempting to find the new vCenter Server certificate in the filesystem is not recommended.
|
USER and PASSWORD |
User with administrator privileges for vCenter Single Sign-On. |
Retrieving the Old Certificate from the BACKUP_STORE
If you are using the vSphere Certificate Manager utility, you can retrieve the old machine SSL certificate from the BACKUP_STORE inside VECS.
Note: The backup store only keeps the last certificate. If you performed multiple replacement actions, you can instead retrieve the certificate from the MOB, as discussed below.
On the vCenter Server Appliance, you retrieve the old certificate thumbprint as follows:
- Run this command and look for the Machine_Cert entry to verify it is the previous certificate:
/usr/lib/vmware-vmafd/bin/vecs-cli entry list --store BACKUP_STORE --text
- Notice bkp___Machine_Cert under Machine_Cert.
- Run this command to output the Machine_Cert from the BACKUP_Store.
/usr/lib/vmware-vmafd/bin/vecs-cli entry getcert --store BACKUP_STORE --alias bkp___MACHINE_CERT --output /certificates/old_machine.crt
- Run this command to output the thumbprint:
openssl certificate -fingerprint< -sha1 -noout /certificates/old_machine.crt -in x509>
You see output similar to:
SHA1 Fingerprint=11:41:9F:D8:CF:27:6B:EA:F7:49:20:##:##:##:##:##:##:##:##
On a vCenter Server Windows system, you retrieve the old certificate as follows:
- Run this command and look for the Machine_Cert entry to verify it is the previous certificate:
"%VMWARE_CIS_HOME%"\vmafdd\vecs-cli entry list --store BACKUP_STORE –text | more
- To output the Machine_Cert from the BACKUP_Store, run this command:
"%VMWARE_CIS_HOME%"\vmafdd\vecs-cli entry getcert --store BACKUP_STORE --alias bkp___MACHINE_CERT --output c:\certificates\old_machine.crt
- Run this command to output the thumbprint:
openssl certificate -fingerprint< -sha1 -noout c:\certificates\old_machine.crt -in x509>
You see output similar to:
SHA1 Fingerprint=11:41:9F:D8:CF:27:6B:EA:F7:49:20:##:##:##:##:##:##:##:##:##:##:##