Continuing with the topic of configuring Apache Tomcat – SSL, we wish to validate the connection using a Java Client program.
The prime motive is to use a standard Java Console application and connect over SSL with an already deployed web portal running on Tomcat.
Use sample Java code – HelloClient.java (Replace the file extension from .java.txt to .java)
Syntax:
java HelloClient ip_address/host_of_server port cert_location keystore_password password_to_access_private_key
Example: $ java client localhost 8443 CliKeystore abcd123 abcd123
Make sure you specify the correct location of the Keystore.
Output:
Login