How to Generate a CSR for Jetty Java HTTPS Servlet Web Server

Article with steps to generate a CSR for Jetty Java HTTPS Servlet Web Server.

1. Run Private Key Generation Command

Generate a keystore and private key by running the following command:

keytool -genkey -alias [enter_alias_name] -keyalg RSA -keystore [enter_keystore_name] -keysize 2048

2. Create a Password

Enter a keystore password.

Java servers will use a default password unless you decide to change it by specifying a customer password in the server.xml configuration file.

3. Enter the CSR Details When Prompted:

Common Name (CN)The FQDN (fully-qualified domain name) you want to secure with the certificate such as www.google.com, secure.website.org, *.domain.net, etc.
Organization Name (ON)The full legal name of your organization including the corporate identifier.
Organizational Unit (OU)Your department such as ‘Information Technology’ or ‘Website Security.’
Locality or City (L)The locality or city where your organization is legally incorporated. Do not abbreviate.
State or Province (S)The state or province where your organization is legally incorporated. Do not abbreviate.
Country Name (C)The official two-letter country code (i.e. US, CH) where your organization is legally incorporated.

4. Select Enter When Prompted for the Private Key Alias Password

This will set the private key password to the same password used for the keystore from Step 2. Please save the private key and keystore password. If lost, they cannot be retrieved and you’ll have to start over.

5. Backup the Keystore File

After creating the Keyentry, by accessing the following directory and saving the file somewhere safe in case of a system crash or failure.

C:\WINNT\Profiles\Administrator\.keystore

Or

C:\Documents and Settings\your name\.keystore

6. Run the CSR Generation Command

Generate a CSR off the Keyentry by running the following command:

keytool -certreq -alias [alias_name] -file certreq.csr -keystore [keystore_name]

Locate and open the newly created CSR in a text editor such as Notepad and copy all the text including:

-----BEGIN CERTIFICATE REQUEST-----
And
-----END CERTIFICATE REQUEST-----

7. Upload Your CSR

After you have received your CSR, return to your 101domain account and upload your CSR or paste in your CSR code.