Knowledge Base
The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides

|
Creating certificate requests and certificates for vCenter Server 5.1 components (2037432)
Purpose
This article provides information on manually configuring Certificate Authority (CA) signed SSL certificates in a vSphere 5.1 environment. VMware has released a tool to automate much of the described process below. Please see Deploying and using the SSL Certificate Automation tool (2041600) before following the steps in the article.
In the case that you are unable to use the tool this article helps you eliminate common causes for problems during certificate implementation, including configuration steps and details, and helps avoid common misconfigurations in the implementation of custom certificates in your environment.
Note: This article is specifically for vSphere 5.1. If you are using vSphere 5.0, see Implementing CA signed SSL Certificates with vSphere 5.0 (2015383).
Note: This article is specifically for vSphere 5.1. If you are using vSphere 5.0, see Implementing CA signed SSL Certificates with vSphere 5.0 (2015383).
Resolution
Note: This article is part of a resolution path. See Implementing CA signed SSL certificates with vSphere 5.1 (2034833) before following the steps in this article.
Creating CA assigned certificates for vSphere is a complex task. In many organizations it is required to maintain proper security for regulatory requirements. There are several different work flows required for successful implementation:
- Creating the OpenSSL configuration files
- Creating the certificate requests
- Getting the certificates
- Implementing the certificates
Before attempting these steps, ensure that:
- You have a vSphere 5.1 environment.
- The environment has been pre-installed for all components for which you will be installing certificates.
- OpenSSL v0.9.8 has been downloaded from http://slproweb.com/products/Win32OpenSSL.html and it has been installed in the default directory. This article assumes it has been installed in
C:\OpenSSL-Win32. If it has been installed elsewhere, substitute the alternative location appropriately. - You are not using wild card certificates. Each certificate needs to be unique in vSphere 5.1 and as a result wild card certificates are not supported.
Creating the OpenSSL configuration files
There are six separate components in vCenter Server 5.1 that utilize certificates to encrypt communication. This article can be used if the components are on the same server and if they are on different servers, as long as you have a separate certificate for each component. The OpenSSL configuration when generating requests must:- Have the subject alternative name field included in them
- Have unique OrganizationalUnitNames for the components
- Include digitalSignature, keyEncipherment, dataEncipherment components for Key Usage
- On the system where you will be generating the certificates, create a folder in which you can store the certificates for the different components. These steps use the
C:\certsfolder as an example. - In the
C:\certsfolder, create six other folders, so that you can organize each of the certificates. These steps use these six folders:
- InventoryService
- SSO
- UpdateManager
- vCenter
- WebClient
- LogBrowser
- Create OpenSSL configuration files for each service. Here is an example of a completed configuration file:
Note: Each SSL Certificate needs a unique Distinguished Name (DN). The examples in this article use the OrganizationalUnitName (OU) field to achieve this uniqueness, based on a configuration where all components are installed on the same server. If the services are all on separate servers, they have a unique DN by default.[ req ]DNS:
default_bits = 2048
default_keyfile = rui.key
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS: vc51-1, DNS:10.0.0.10,vc51-1.vmware.com
[ req_distinguished_name ]
countryName = US
stateOrProvinceName = NY
localityName = New York
0.organizationName = VMWare
organizationalUnitName = vCenterInventoryService
commonName = vc51-1.vmware.com
Note: The country name is always the two-digit country code for the country.
Steps 4 to 9 discuss the changes that need to be made in each certificate file. At least onesubjectAltNameshould be in place for each server that matches thecommonNamefield.
- For the Inventory Service, create a file in
C:\certs\InventoryServicecalledinventoryservice.cfg. Paste this text into the file, changing the elements inRed:[ req ]
default_bits = 2048
default_keyfile = rui.key
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:ServerShortName, DNS:ServerIPAddress, DNS:server.domain.com
[ req_distinguished_name ]
countryName = Country
stateOrProvinceName = State
localityName = City
0.organizationName = Company Name
organizationalUnitName = vCenterInventoryService
commonName = server.domain.com
- For vCenter Server SSO, create a file in
C:\certs\SSOcalledsso.cfg. Paste this text into the file, changing the elements inRed:[ req ]
default_bits = 2048
default_keyfile = rui.key
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:ServerShortName, DNS:ServerIPAddress, DNS:server.domain.com
[ req_distinguished_name ]
countryName = Country
stateOrProvinceName = State
localityName = City
0.organizationName = Company Name
organizationalUnitName = vCenterSSO
commonName = server.domain.com
- For the VirtualCenter Server Service, create a file in
C:\certs\vCentercalledvcenter.cfg. Paste this text into the file, changing the elements inRed:[ req ]
default_bits = 2048
default_keyfile = rui.key
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:ServerShortName, DNS:ServerIPAddress, DNS:server.domain.com
[ req_distinguished_name ]
countryName = Country
stateOrProvinceName = State
localityName = City
0.organizationName = Company Name
organizationalUnitName = vCenterServer
commonName = server.domain.com
- For the vSphere Web Client, create a file in
C:\certs\WebClientcalledwebclient.cfg. Paste this text into the file, changing the elements inRed:[ req ]
default_bits = 2048
default_keyfile = rui.key
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:ServerShortName, DNS:ServerIPAddress, DNS:server.domain.com
[ req_distinguished_name ]
countryName = Country
stateOrProvinceName = State
localityName = City
0.organizationName = Company Name
organizationalUnitName = vCenterWebClient
commonName = server.domain.com
- For the VMware Log Browser, create a file in
C:\certs\LogBrowsercalledLogBrowser.cfg. Paste this text into the file, changing the elements inRed:[ req ]
default_bits = 2048
default_keyfile = rui.key
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuthsubjectAltName = DNS:ServerShortName, DNS:ServerIPAddress, DNS:server.domain.com
[ req_distinguished_name ]
countryName = Country
stateOrProvinceName = State
localityName = City
0.organizationName = Company Name
organizationalUnitName = vCenterLogBrowser
commonName = server.domain.com
- For vSphere Update Manager, create a file in
C:\certs\UpdateManagercalledUpdateManager.cfg. Paste this text into the file, changing the elements inRed:[ req ]
default_bits = 2048
default_keyfile = rui.key
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:ServerShortName, DNS:ServerIPAddress, DNS:server.domain.com
[ req_distinguished_name ]
countryName = Country
stateOrProvinceName = State
localityName = City
0.organizationName = Company Name
organizationalUnitName = VMwareUpdateManager
commonName = server.domain.com
Generating certificate requests
Now that OpenSSL has been configured, you need to generate a certificate request for each of the components:- Launch a command prompt and navigate into the OpenSSL directory. By default, this is
C:\OpenSSL-Win32\bin. - Run this command to create the Inventory Service certificate request and export the private key:
openssl req -new -nodes -out c:\certs\InventoryService\rui.csr -keyout c:\certs\InventoryService\rui-orig.key -config c:\certs\InventoryService\inventoryservice.cfg
- Convert the key to the proper RSA format for the Inventory Service to use:
openssl rsa -in c:\certs\InventoryService\rui-orig.key -out c:\certs\InventoryService\rui.key
- Run this command to create the vCenter SSO certificate request and export the private key:
openssl req -new -nodes -out c:\certs\sso\rui.csr -keyout c:\certs\sso\rui-orig.key -config c:\certs\sso\sso.cfg
- Convert the key to the proper RSA format for vCenter Server SSO to use:
openssl rsa -in c:\certs\sso\rui-orig.key -out c:\certs\sso\rui.key
- Run this command to create the vCenter Server Service certificate request and export the private key:
openssl req -new -nodes -out c:\certs\vCenter\rui.csr -keyout c:\certs\vCenter\rui-orig.key -config c:\certs\vCenter\vcenter.cfg
- Convert the key to the proper RSA format for vCenter Server to use:
openssl rsa -in c:\certs\vCenter\rui-orig.key -out c:\certs\vCenter\rui.key
- Run this command to create the vSphere Web Client certificate request and export the private key:
openssl req -new -nodes -out c:\certs\WebClient\rui.csr -keyout c:\certs\WebClient\rui-orig.key -config c:\certs\WebClient\webclient.cfg
- Convert the key to the proper RSA format for the vSphere Web Client to use:
openssl rsa -in c:\certs\WebClient\rui-orig.key -out c:\certs\WebClient\rui.key
- Run this command to create the vSphere Log Browser certificate request and export the private key:
openssl req -new -nodes -out c:\certs\LogBrowser\rui.csr -keyout c:\certs\LogBrowser\rui-orig.key -config c:\certs\LogBrowser\logbrowser.cfg
- Convert the key to the proper RSA format for the Log Browser to use:
openssl rsa -in c:\certs\LogBrowser\rui-orig.key -out c:\certs\LogBrowser\rui.key
- Execute this command to create the vSphere Update Manager certificate request and export the private key:
openssl req -new -nodes -out c:\certs\UpdateManager\rui.csr -keyout c:\certs\UpdateManager\rui-orig.key -config c:\certs\UpdateManager\updatemanager.cfg
- Convert the key to the proper RSA format for vSphere Update Manager to use:
openssl rsa -in c:\certs\UpdateManager\rui-orig.key -out c:\certs\UpdateManager\rui.key
After running the above commands, you now have the
openssl req -in rui.csr -noout -text
Once run, take a look over the output to verify the output to make sure that all of the parameters entered in the .cfg file are properly set in the request.
Proceed to Getting the certificate.
rui.csr and rui.key files located in each of the respective six directories for the different services. If you would like to validate that the csr is created correctly you can run:openssl req -in rui.csr -noout -text
Once run, take a look over the output to verify the output to make sure that all of the parameters entered in the .cfg file are properly set in the request.
Proceed to Getting the certificate.
Getting the certificate
After the certificate request is created, it must be given to the certificate authority for generation of the actual certificate. The authority presents a certificate back and, if appropriate, a copy of their root certificate. For the certificate chain to be trusted, the root certificate must be installed on the server.Follow the appropriate section below for the steps for the certificate authority in question.
For Commercial CAs, follow these steps for each certificate request:
- Take the certificate request (
rui.csr, as generated above) and send it to the authority in question. - The authority sends back the generated certificate.
Note: Based on the requirements of the key, ensure that the WebServer Template has been copied to allow for encryption of user data. This can be normally found in Certificate Manager > Extensions > Key Usage > Allow encryption of user data.
- Log into the Microsoft CA certificate authority Web interface. By default, it is
http://servername/CertSrv/. - Click the Request a certificate link.
- Click advanced certificate request.
- Click the Submit a certificate request by using a base-64-encoded CMC or PKCS #10 file, or submit a renewal request by using a base-64-encoded PKCS #7 file link.
- Open the certificate request in a plain text editor and paste this text into the Saved Request box:
-----BEGIN CERTIFICATE REQUEST-----to-----END CERTIFICATE REQUEST-----
- Select the Certificate Template as the appropriate Web Server template. This is generally a copy of the Web Server Template with the Allow encryption of user data setting set.
- Click Submit to submit the request.
- Click Base 64 encoded on the Certificate issued screen.
- Click the Download Certificate link.
- Save the certificate as
rui.crtin the appropriatec:\certs\<service>folder. - Repeat Steps 2 to 10 for each additional service. Confirm that the three key usages are present on the
.crtfile by viewing its properties. The default install of Windows Server 2008 with the CA role will not create.crtfiles properly. You must first modify thedigitalSignature,keyEncipherment, anddataEnciphermentfields on the CA before continuing.
- Navigate back to the home page of the certificate server and click Download a CA certificate, certificate chain or CRL.
- Click the Base 64 option.
- Click the Download CA Certificate chain link.
- Save the certificate chain as
cachain.p7bin thec:\certsfolder. - Double-click he
cachain.p7bfile and navigate to C:\certs\cachain.p7b > Certificates. - Right-click the certificate listed and select All Actions > Export.
- Click Next.
- Select Base-64 encoded X.509 (.CER), and then click Next.
- Save the export to
C:\certs\Root64.cerand click Next.
Note: This assumes there are no intermediate certificates in the Certificate Authority. If there are two or more levels in the Certificate Authorities, before exporting the certificate into Base-64 encoded X.509 (.CER), if you have multiple certificates on the.p7bfile, you will not be able to export them to Base64 at the same time; you must export them one by one instead.
For example, create files namedC:\certs\Root64-1.cer,C:\certs\Root64-2.cer, etc. Once complete, concatenate the certificates into a single file namedRoot64.cer, which will be used in the subsequent commands.
To concatenate the two files on Windows, open a Windows command prompt, navigate to the certificates directory, then run the command:copy root64-1.cer+Root64-2.cer Root64.cer
If this is not correctly done before the PFX and JKS files are created below, logging into the vSphere Web Client and other components and commands will fail.
- Click Finish.
rui.crt file and validate that the proper alternative names and subjects are in each certificate. When complete, the certificates are generated and you now have the rui.key and rui.crt files for each service and the Root64.cer root certificate. Proceed to Creating the PFX and follow the steps for each certificate.Creating the PFX
When you have the certificate created, you can generate the PKCS#12 PFX file for use with each of the services.To create the PFX file for each service:
Note: The commands here are different than many other PFX creation commands, as they include the CA certificate chain within the PFX file as well.
- Launch a command prompt and navigate into the OpenSSL directory. By default, this is
C:\OpenSSL-Win32\bin. - Run this command to create the
rui.pfxfile for the Inventory service:openssl pkcs12 -export -in c:\certs\InventoryService\rui.crt -inkey c:\certs\InventoryService\rui.key -certfile c:\certs\Root64.cer -name "rui" -passout pass:testpassword -out c:\certs\InventoryService\rui.pfx
Note: The certificate store password must betestpassword. Do not change this parameter.
- Run this command to create the
rui.pfxfile for vCenter Server SSO:openssl pkcs12 -export -in c:\certs\sso\rui.crt -inkey c:\certs\sso\rui.key -certfile c:\certs\Root64.cer -name "rui" -passout pass:testpassword -out c:\certs\sso\rui.pfx
Note: The certificate store password must betestpassword. Do not change this parameter.
- Run this command to create the
rui.pfxfile for the vCenter Server:openssl pkcs12 -export -in c:\certs\vcenter\rui.crt -inkey c:\certs\vcenter\rui-orig.key -certfile c:\certs\Root64.cer -name "rui" -passout pass:testpassword -out c:\certs\vcenter\rui.pfx
- Run this command to create the
rui.pfxfile for the vSphere Web Client:openssl pkcs12 -export -in c:\certs\webclient\rui.crt -inkey c:\certs\webclient\rui.key -certfile c:\certs\Root64.cer -name "rui" -passout pass:testpassword -out c:\certs\webclient\rui.pfx
- Run this command to create the
rui.pfxfile for the Log Browser:openssl pkcs12 -export -in c:\certs\LogBrowser\rui.crt -inkey c:\certs\LogBrowser\rui.key -certfile c:\certs\Root64.cer -name "rui" -passout pass:testpassword -out c:\certs\LogBrowser\rui.pfx
- Run this command to create the
rui.pfxfile for vSphere Update Manager:openssl pkcs12 -export -in c:\certs\updatemanager\rui.crt -inkey c:\certs\updatemanager\rui.key -certfile c:\certs\Root64.cer -name "rui" -passout pass:testpassword -out c:\certs\updatemanager\rui.pfx
- The PFX files are created. To test the encoding, run this command:
openssl pkcs12 -in c:\certs\<service>\rui.pfx -info
When prompted for a password, usetestpasswordfor both the password and the passphrase. This is purely to decode the information in the PFX file and check the validity. The output should match the Distinguished Name (DN) in the certificates and is shown along with the certificate content in the output of the-infocommand.
Creating the JKS
Once the PFX files are created, you can create the Java Keystore file (JKS) for use with the configuration.To create the JKS:
- Open a command prompt on the vCenter Single Sign-On server.
- Navigate to the
C:\Program Files\VMware\Infrastructure\jre\bin\directory. - Run the command:
keytool -v -importkeystore -srckeystore C:\certs\sso\rui.pfx -srcstoretype pkcs12 -srcstorepass testpassword -srcalias rui -destkeystore C:\certs\sso\root-trust.jks -deststoretype JKS -deststorepass testpassword -destkeypass testpassword
- Once created, you must add the root certificate to the JKS file with the alias
root-ca. To add the root certificate, run the command:keytool -v -importcert -keystore C:\certs\sso\root-trust.jks -deststoretype JKS -storepass testpassword -keypass testpassword -file c:\certs\Root64.cer -alias root-ca
- When asked if you want to trust this certificate, type
yes. A message sayingCertificate was added to the keystoreis displayed. - If there are intermediate certificates in the certificate chain, they also must be added to the JKS file. Repeat this step for each Intermediate CA Certificate. To add any intermediate certificates, run the command:
keytool -v -importcert -noprompt -trustcacerts -keystore C:\certs\sso\root-trust.jks -deststoretype JKS -storepass testpassword -keypass testpassword -file C:\certs\<intercacert>.cer -alias intermediate-<hash>.0
Where<intercacert>is the certificate for the intermediate CA (in this example,Root64-1.ceris used), and<hash>is the hash generated by this OpenSSL command:openssl x509 -subject_hash -noout -in c:\certs\<intercacert>.cer
Note: The hash must be created with OpenSSL v0.9.8 as this is the version which vCenter Server uses. If created with another version, the hash may not be correct.
- When complete, run this command to check that the certificates have been imported successfully:
keytool -list -v -keystore c:\certs\sso\root-trust.jks
- Copy
c:\certs\sso\root-trust.jkstoc:\certs\sso\server-identity.jks.
You now have all of the files required to implement custom SSL certificates. Be sure to copy the
c:\certs folder to the vCenter Server if all services are running on a single server. Otherwise, copy the respective certificates to the appropriate servers.Proceed to the next article in this resolution path, Implementing CA signed SSL certificates with vSphere 5.1 (2034833), to replace the vCenter SSO certificates.
Additional Information
For Certificates issued by Enterprise CAs, the validity period is defined in the template used to create the certificate. Windows 2000 and Windows Server 2003 Standard Edition do not support modification of these templates.
For more information, see the Microsoft Knowledge Base article 254632.
See Also
- Implementing CA signed SSL certificates with vSphere 5.1
- Deploying and using the SSL Certificate Automation Tool
Update History
Request a Product Feature
To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.
Actions
KB:
- Updated:
- Categories:
- Languages:
- Product Family:
- Product(s):
- Product Version(s):

