root@vc [ ~/.acme.sh ]# /usr/lib/vmware-vmca/bin/certificate-manager [520/982] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | | *** Welcome to the vSphere 7.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 | | NOTE: Solution user certs will be deprecated in a future | | release of vCenter. Refer to release notes for more details.| | | | 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-D to exit. Option[1 to 8]: 1
Please provide valid SSO and VC privileged user credential to perform certificate operations. Enter username [Administrator@vsphere.local]: Enter 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]: 2
Please provide valid custom certificate for Machine SSL. File : /root/.acme.sh/xxxxx.com/xxxxx.com.cer
Please provide valid custom key for Machine SSL. File : /root/.acme.sh/xxxxx.com/xxxxx.com.key
Please provide the signing certificate of the Machine SSL certificate File : /root/.acme.sh/xxxxx.com/fullchain.cer
You are going to replace Machine SSL cert using custom cert Continue operation : Option[Y/N] ? : Y Command Output: /root/.acme.sh/xxxxx.com/xxxxx.com.cer: OK
Status : 100% Completed [All tasks completed successfully]
五、自动化脚本
确认证书替换成功后, 我们就可以弄个自动化脚本然后自动更新了; 不过需要注意的是: 如果 vCenter Server 的 FQDN(PNID) 在安装时配置错误(域名没有做解析), 那么此时 vCenter Server PNID 将会变为 IP, 更新证书必然会失败.