KB: vRealize Automation – Change the VAMI certificate

Set the certificate private key password in a shell variable

1INKEY="<<CERT_PASSPHRASE>>"

Get a PFX file from original cert

1openssl pkcs12 -export \
2    -in <<fqdn>>.crt \
3    -inkey <<fqdn>>.key \
4    -certfile ca-root.crt \
5    -name "rui" \
6    -passout pass:$INKEY \
7    -out <<fqdn>>.pfx

Get PEM file from orginial cert

1openssl pkcs12 \
2    -in <<fqdn>>.pfx \
3    -inkey <<fqdn>>.key \
4    -out <<fqdn>>.pem \
5    -nodes \
6    -passin pass:$INKEY

Replace lighttpd certificates

1mv /opt/vmware/etc/lighttpd/server.pem /opt/vmware/etc/lighttpd/server.pem-bak
2cp <<fqdn>>.pem /opt/vmware/etc/lighttpd/server.pem
3service vami-lighttp restart