From NSX version 4.2 onwards, the NSX Certificate Management introduces operational ease via NSX's revamped certificate management capabilities such as :-
VMware NSX Version 4.2 and later
This procedure applies to all NSX components with self-signed certificates only.
To replace the certificate using the API, refer the article here Replace Certificates Through API
To replace the certificate using the CARR script, refer the article here Using Certificate Analyzer, Results and Recovery (CARR) Script to fix certificate related issues in NSX