Created
September 19, 2017 21:20
-
-
Save dlinsley/c66c8532607789ebd7eaa9fe2327eed0 to your computer and use it in GitHub Desktop.
Replace machine certificate with CA signed certificate on vCenter Appliance 6.5 with embedded PSC without using the vSphere Certificate Manager Utility using vRO Guest Script manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Scriptable Tasks Inputs: | |
// | |
// | |
//Scriptable Tasks Outputs: | |
// | |
// script - String - script to execute with guest script manager | |
script = "/usr/lib/vmware-vmafd/bin/vecs-cli entry getcert --store MACHINE_SSL_CERT --alias __MACHINE_CERT --output /usr/lib/vmware-vmafd/bin/original.crt\n"; | |
script += "/usr/bin/openssl x509 -in /usr/lib/vmware-vmafd/bin/original.crt -noout -sha1 -fingerprint | /usr/bin/cut -d= -f 2"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Scriptable Tasks Inputs: | |
// | |
// cert - String - PEM encoded new certificate | |
// key - String - PEM encoded private key of new Certificate | |
// intermediary1 - String - PEM encoded intermediary certificate | |
// intermediary2 - String - PEM encoded intermediary certificate (if more than one is required) | |
// originalThumbprint - String - SHA1 thumbprint of the existing machine certificate | |
// password - SecureString - password of SSO admin user: [email protected] | |
// | |
//Scriptable Tasks Outputs: | |
// | |
// script - String - script to execute with guest script manager | |
script = "echo '"+cert+"' > /usr/lib/vmware-vmafd/bin/newcert\n"; | |
script += "echo '"+key+"' > /usr/lib/vmware-vmafd/bin/newkey\n"; | |
script += "echo '"+intermediary1+"' > /usr/lib/vmware-vmafd/bin/intermediatecert\n"; | |
script += "echo '"+intermediary2+"' >> /usr/lib/vmware-vmafd/bin/intermediatecert\n"; | |
script += "/usr/lib/vmware-vmafd/bin/dir-cli trustedcert publish --chain --cert /usr/lib/vmware-vmafd/bin/intermediatecert --login [email protected] --password '"+password+"'\n"; | |
script += "/usr/lib/vmware-vmafd/bin/vecs-cli force-refresh\n"; | |
script += "/usr/lib/vmware-vmafd/bin/vecs-cli entry delete --store MACHINE_SSL_CERT --alias __MACHINE_CERT -y\n"; | |
script += "/usr/lib/vmware-vmafd/bin/vecs-cli entry create --store MACHINE_SSL_CERT --alias __MACHINE_CERT --cert /usr/lib/vmware-vmafd/bin/newcert --key /usr/lib/vmware-vmafd/bin/newkey\n"; | |
script += "VMWARE_JAVA_HOME=/usr/java/jre-vmware VMWARE_CFG_DIR=/etc/vmware /usr/lib/vmidentity/tools/scripts/ls_update_certs.py --url https://localhost/lookupservice/sdk --fingerprint "+originalThumbprint+" --certfile /usr/lib/vmware-vmafd/bin/newcert --user [email protected] --password '"+password+"'\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment