I have a wildcard.pfx certificate which I need to use in my vCD instance. Here are the steps to convert the certificate and import into vCD:
- Convert the pfx to pem:
- openssl pkcs12 -in certificate.pfx -out certificate.cer –nodes
- Extract the private key from the certificate.cer.
- copy from —–BEGIN PRIVATE CERTIFICATE—–
- to end of —–END PRIVATE CERTIFICATE—–
- Create new file called certificate.key and paste
- Recreate pfx and set alias for http
- openssl pkcs12 -export -in certificate.cer -inkey certificate.key -name http -passout pass:yourpassword -out http.pfx
- Recreate pfx and set alias for consoleproxy
- openssl pkcs12 -export -in certificate.cer -inkey certificate.key -name consoleproxy -passout pass:yourpassword -out consoleproxy.pfx
- Import the 2 PKCS12 keystores into Java keystore using keystore
- ./keytool -importkeystore -srckeystore http.pfx -srcstoretype PKCS12 -destkeystore certificate.ks -deststoretype JCEKS -deststorepass yourpassword -srcalias http -destalias http -srcstorepass yourpassword
- ./keytool -importkeystore -srckeystore consoleproxy.pfx -srcstoretype PKCS12 -destkeystore certificate.ks -deststoretype JCEKS -deststorepass yourpassword -srcalias consoleproxy -destalias consoleproxy -srcstorepass yourpassword
- Now import the root and intermediate certificates (if any) to the same keystore
- ./keytool -importcert -alias root -file GeoTrust_Global_CA.cer -storetype JCEKS -keystore certificate.ks -storepass yourpassword
- keytool -importcert -alias intermediate -file RapidSSL.cer -storetype JCEKS -keystore certificate.ks -storepass yourpassword
To replace it your can read my previous blog post