/opt/vmware/sddc-support/sos --certificate-health
VMware Cloud Foundation 4.x
VMware Cloud Foundation 5.x
Note: It is strongly recommended to take a snapshot of the SDDC Manager VM before proceeding with the steps below.
For the scripted method please download the script attached to the bottom of this article and run it as root user on the sddc manager appliance in the vcf/home directory:
After running this script sometimes it might fail with the error : /bin/bash^M: bad interpreter: No such file or directory
Then execute the below command & rerun the script.
sed -i -e 's/\r$//' renew_sddc_cert_with_vmca.sh
openssl req -new -newkey rsa:2048 -nodes -keyout sddc-manager.example.com.key -out sddc-manager.example.com.csr
mkdir /tmp/certs
[ req ]
req_extensions = v3_req
[ v3_req ]
extendedKeyUsage = serverAuth, clientAuth
authorityKeyIdentifier=keyid,issuer
authorityInfoAccess = caIssuers;URI:https://mgmt-vcenter.example.com/afd/vecs/ca
subjectAltName=IP:<SDDC ip_address>,DNS:<SDDC FQDN>
openssl x509 -req -days 3650 -in sddc-manager.example.com.csr -out sddc-manager.example.com.crt -CA /var/lib/vmware/vmca/root.cer -CAkey /var/lib/vmware/vmca/privatekey.pem -extensions v3_req -CAcreateserial -extfile cert.cfg
cat sddc-manager.example.com.crt>>sddc-manager.example.com.pem
cat /var/lib/vmware/vmca/root.cer>>sddc-manager.example.com.pem
cp /etc/ssl/private/vcf_https.key /etc/ssl/private/old_vcf_https.key
cp /etc/ssl/certs/vcf_https.crt /etc/ssl/certs/old_vcf_https.crt
rm /etc/ssl/certs/vcf_https.crt
mv /home/vcf/sddc-manager.example.com.pem /etc/ssl/certs/vcf_https.crt
mv /home/vcf/sddc-manager.example.com.key /etc/ssl/private/vcf_https.key
chmod 644 /etc/ssl/certs/vcf_https.crt
chmod 640 /etc/ssl/private/vcf_https.key
nginx -t && systemctl reload nginx