Scripted process to Replace Expired or Self-signed VMware NSX-T Manager Certificates with VMCA-Signed Certificates
search cancel

Scripted process to Replace Expired or Self-signed VMware NSX-T Manager Certificates with VMCA-Signed Certificates

book

Article ID: 317900

calendar_today

Updated On:

Products

VMware Cloud Foundation VMware NSX VMware NSX-T Data Center

Issue/Introduction

The process of generating a Certificate Signing Request (CSR), creating a certificate, importing and deploying the certificate via the VMware Certificate Authority (VMCA) involves manual work, with making REST API calls.
This KB article helps to automate the entire process with a script.

There are expired certificates or self-signed certificates on the NSX Managers and NSX VIP:
  • Due to the expired certificates - these cannot be replaced by a management interface like the SDDC Manager - they have to replaced directly on the NSX Managers.
  • Due to self-signed certificates - SDDC Manager does not trust the certificate, and therefore needs to be replaced with a VMCA signed certificate.

Environment

VMware NSX-T Data Center
VMware NSX 

Cause

Expired or Self-Signed certificates on the NSX Manager nodes lead to alarms and may impact workflow, such as those with the VCF SDDC Manager.

Resolution

NOTE: The script needs to be run on the vCenter Sever (Compute Manager) registered to the VMware NSX Managers, confirm under: System > Fabric > Compute Managers.

The script will only replace the Manager Node Certificate and Cluster (VIP) certificate, it is not intended to be used for any other certificates.

The script is available to download from this KB article.



Script Usage:

To see the syntax and commands available, run python nsxVmcaCert.py


  1. Download the script nsxtVmcaCert.py. Ensure you name the file as you see it listed in this KB article.  Copy it to the vCenter Server connected to the VMware NSX environment. If you encounter trouble copying the script to vCenter, the instructions in Connecting to vCenter Server Virtual Appliance using WinSCP fails with the error: Received too large (1433299822 B) SFTP packet. Max supported packet size is 1024000 B will help enable SCP for root on the vCenter Server, allowing you to copy the script to the vCenter Server.
  2. Run the script with the FQDN of the NSX manager node or the VIP, with the appropriate flags, and supply the password for the admin user:
    1. Command for NSX Manager, node certificate replacement, repeat for each manager node in the cluster:
      # python nsxtVmcaCert.py -f <nsx_manager_fqdn> -m
    2. You will be prompted for the VMware NSX manager admin user's password, enter to proceed.



    3. Command for the Cluster VIP, only need to run against one manager:
      # python nsxtVmcaCert.py -f <nsxt_vip_fqdn> -v



The script needs to be re-run for each VMware NSX Manager and VIP that we need to replace the certificates on.

For example:
If there are three VMware NSX Manager nodes VIP configured, the script needs to be run four times:

python nsxtVmcaCert.py -f <nsx-manager-node1-fqdn> -m

python nsxtVmcaCert.py -f <nsx-manager-node2-fqdn> -m

python nsxtVmcaCert.py -f <nsx-manager-node3-fqdn> -m

python nsxtVmcaCert.py -f <cluster-vip-fqdn-address> -v

▶

NOTE: The FQDN for the NSX manager can be verified with the below API call, and the same FQDN value must be passed to run the python script for replacing the certificates:
GET https://<NSX-Manager-IP>/api/v1/cluster

Additional Information

Note: Update any 2nd Party (such as vROPS, vRLI etc) and 3rd Party products that have integrations with the NSX Managers to update and accept the new certificates.

 

File checksum info:

The hashes listed are only valid for the current version of nsxtVmcaCert.py. 
Date hash updated: July 1,2025

MD5SUM: 543646e258b6ea438169535ca0f7eef7
SHA256SUM: 11174436b35ceb6281e35414d8c08288b8cff8b46a7dd67d11fe12d20fbec542

 

If the NSX Manager is configured with a short hostname, or if the input to the script was not a case sensitive match to the manager's hostname, the script will fail with: 

Failed to get the UUID associated with the name ######. Ensure the manager's hostname is set to the fully qualified domain name and the input to this command matches (including case).

The affected NSX Manager's hostname can be updated to a FQDN by executing the following from the CLI: set hostname <fqdn>

Attachments

nsxtVmcaCert_1751393783299.py get_app