How to create self signed certificate for Tomcat

SSL Certificate are required to protect web pages and sensitive data from attackers. A self signed certificate can be useful to encrypt data in tomcat.

steps to create a self signed certificate for Tomcat

Step – 1. First step is to create a directory to store a certificate.

IE:”C:\ssl” 

Step – 2. Open a command window (dos prompt) and CD to that directory

c:

cd \ssl

Step – 3. Type following comment to proceed

keytool -genkey -alias tomcat -keyalg RSA -keystore ./keystore

Step – 4. You will be asked a series of questions including password, Put a strong password and remind it for further process.

Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: VR Weinstein
What is the name of your organizational unit?
[Unknown]: DataSolutions
What is the name of your organization?
[Unknown]: DataSolutions
What is the name of your City or Locality?
[Unknown]: Largo
What is the name of your State or Province?
[Unknown]: Florida
What is the two-letter country code for this unit?
[Unknown]: US
Is CN=VR Weinstein, OU=DataSolutions, O=DataSolutions, L=Largo, ST=Florida
, C=US correct?
[no]: y

Enter key password for <tomcat>
RETURN if same as keystore password):<tomcat>

Step – 5. You will be shown all of your entries and Hit enter to confirm.

You will be asked for your password again with the option to just hit enter. The keystore will be generated in the current working directory.