Before you configure HTTPS on Tomcat you need to first generate self-signed certificate. This certificate will not be trusted certificate from certificate issuing agency but an untrusted one for testing purpose.
With this certificate browser will prompt you with error message.
Step 1 :
Generate certificate with below command
You may get below error
This is because you have not given file name
If you get below error
remove existing file and generate key again
Fill password and other details
Go to tomcat’s server.xml and change as below
Update entries marked in “red”
Restart your tomcat and fire https://localhost:8443 you will see below
This error is because your certificate is not trusted and is not issued by trusted authority
Click on “Continue to this website (not recommended)” as you are now running on https
If you get below error this means password in certificate and password in “server.xml” file are not same
ENJOY ! God BLESS YOU !