Setting up Tomcat to provide self-signed SSL certificates allowing secure client/server communication and relatively easy to set up. Java provides a handy command-line tool called keytool that you can use to generate keystores.
Generate the Client and Server Keystores :
By following the instructions below, you will create two keystores:
clientkeystore.jks (for the client to use) and serverkeystore.jks (for the server to use). In order to provide copies of the client’s certificate to the server (and vice versa), you will export public certificates based on the private keys.