Tutorial

First, you need to Read JDJ Article. The article will explain how to set up a self-signed SSL certificate and how to configure Tomcat to use it.

When configuring Tomcat, edit server.xml and change the HTTPS connector port to 443 instead of the default 8443. The client applications in the binary distribution of this project are setup to use port 443.

If you do not want to change the HTTPS connector to port 443, you will have to update WebServiceURLPaths.properties. For the Web Service Clients, This file is located inside lib/ferris-jdj-webservice-common-X.Y.Z.jar. For the source, this file is located in the ferris-jdj-webservice-common project in the src/main/resources/ directory. Update the URL in WebServiceURLPaths.properties so the URL contains whatever port number the HTTPS connector is configured for in Tomcat.

Drop JDJArticle.war into the /webapps directory and start Tomcat.

Open a web browser and go to: http://localhost/JDJArticle. If you don't see the JDJArticle home page something's wrong and must be fixed before proceeding.

Open a web browser and go to: https://localhost/JDJArticle. The browser should prompt you with a dialog box asking you if you want to trust the certificate. Choose the option to accept the certificate and proceed. If you don't see the JDJArticle home page something's wrong and must be fixed before proceeding.

Follow the instructions in the article to export the self-signed certificate. Export the certificate to tomcat.cer. Follow the instructions in the article to import the tomcat.cer file into a new keystore named CustomKeystore. Make sure you use the password specified in the article.

You now need to use the CustomKeystore you just created. For the Web Service Clients, This file is located inside lib/ferris-jdj-webservice-common-X.Y.Z.jar. For the source, this file is located in the ferris-jdj-webservice-common project in the src/main/resources/ directory. copy over the existing CustomKeystore with the CustomKeystore you just created.

To execute the socketfactory Web Service client, double-click the ferris-jdj-webservice-socketfactory-X.Y.Z.jar file or run the client with the following command:

java -jar ferris-jdj-webservice-socketfactory-X.Y.Z.jar
		  

If successful, it will look something like this:

To execute the truststore Web Service client, double-click the ferris-jdj-webservice-truststore-X.Y.Z.jar file or run the client with the following command:

java -jar ferris-jdj-webservice-truststore-X.Y.Z.jar
		  

If successful, it will look something like this:

That's it. Have fun!