The steps below are for installing a PKCS#7 (.P7B, .P7S) formatted certificate into a keystore. If you have a X.509 (.CER, .CRT) please click here for X.509 installation documentation.
Step 1: Download the server certificate:
- Download the certificate as PKCS#7
Step 2: Importing the certificate into the keystore:
- Execute the command below to import the PKCS#7 certificate. This command will import the server certificate and the intermediate ca certificate as both are contained within a PKCS#7 formatted certificate.
keytool -import -alias [keyAlias] -trustcacerts -file [certificate.p7b] -keystore [keystore.kdb]
Note: When executing the command to import the SSL certificate, the alias of the private key used to genreate the CSR must be used. Depending on the version of Java used, this alias should be listed with the type keyAlias or privateKeyAlias. To review the keystore contents, execute the command below.
keytool -list -v -keystore [keystore_file.kdb]
If the installation is successful you will see "Certificate reply was installed in keystore". If the import failed, please search for the error in our Knowledge Base.
Step 3: Configure the Tomcat server:
- Locate the tomcat configuration file (example Server.xml), the configuration file name can be different depending on your Tomcat version or distribution. The configuration file will need to be updated to reference your keystore file and password.
- Open the Server.xml file in a text editor (such as VI or Notepad)
- Find the following section of code in the file (try searching for SSL Connector) and remove the comment tags, if included, that are around the connector entry (highlighted in red).
<-- SSL Connector on Port 8443 -->
keystoreFile="insert path to the keystore here">
keystorePass="insert keystore password here">
- Update the
keystoreFile value to the path and file of the keystore.
- Update the
keystorePass value to the keystore password.
- Save the Server.xml file
- Start Tomcat
Note: By default Tomcat runs SSL over port 8443. Make sure that this port is enabled on the Tomcat server and any firewalls/proxies this server may lie behind.
Verify the installation of the RapidSSL certificate using the Checker.