-
Notifications
You must be signed in to change notification settings - Fork 15
server ssl certificate
Wiki ▸ Server Installation ▸ SSL Certificat Installation
Use these instructions to create a keystore file and import an SSL certificate into it.
-
Create a keystore:
keytool -genkey -keyalg RSA -keysize 2048 -alias <server_domain_name> -keystore biobank.keystore
Replace
<server_domain_name>
with the host name of your server.Use
biobank2
as the password. Use the same password for the keystore.When prompted for your name, enter the name of the host, not your own name.
If -alias is NOT specified, "mykey" will be used as the default alias. This can cause a lot of grief in the future when attempting to import certificates.
-
Generate a CSR:
keytool -certreq -keyalg RSA -alias <server_domain_name> -file <csr_file_name> -keystore biobank.keystore
Replace
<server_domain_name>
with the host name of your server, and<csr_file_name>
with a file name to be used in the next step. -
Submit the file
<csr_file_name>
to the certificate signing authority. E.g. Global Sign. -
The certificate signing authority will reply with a certificate email. Download the X509 certificate under and save it as
primary.cer
. The intermediate certificate should be saved asinter.cer
. The root certificate should be saved asroot.cer
. -
Import the certificates:
-
root:
```sh
keytool -import -trustcacerts -file root.cer -alias root -keystore biobank.keystore
```
If you receive a message that says `Certificate already exists in system-wide CA keystore under
alias <...> Do you still want to add it to your own keystore? [no]:`, select Yes. If successful,
you will see `Certificate was added to keystore`.
- intermediate:
```sh
keytool -import -trustcacerts -file inter.cer -alias inter -keystore biobank.keystore
```
If successful, you will see "Certificate was added to keystore".
- certificate:
```sh
keytool -import -file primary.cer -alias <server_domain_name> -keystore biobank.keystore
```
Replace `<server_domain_name>` with the host name of your server.
When imported successfully, the message `certificate reply imported` is displayed.
-
Copy
biobank.keystore
to the Tomcat server.cp biobank.keystore /opt/tomcat/apache-tomcat-8.5.30/conf