I have scanned SO and found there is no detailed instructions on how to install letsencrypt.org SSL certificate on glassfish and specifically in this tutorial I will be using glassfish 4.1.2 build 1. After a lot of trial and error, I was able to put together the following guide. So I hope that it is fine to ask and answer my own question.
In this tutorial I shall be using an Ubuntu 16.04 LTS Server with Shell access from my Ubuntu 16.04 LTS desktop.
visit certbot and follow the instructions below to setup your system
Install
On Ubuntu systems, the Certbot team maintains a PPA. Once you add it to your list of repositories all you'll need to do is apt-get the following packages.
Get Started
Since your server architecture doesn't yet support automatic installation you'll have to use the certonly command to obtain your certificate.
terminal will output
We select the 1st option key in 1 and press enter
terminal will output
terminal will output
terminal will output
Automating renewal
The Certbot packages on your system come with a cron job that will renew your certificates automatically before they expire. Since Let's Encrypt certificates last for 90 days, it's highly advisable to take advantage of this feature. You can test automatic renewal for your certificates by running this command:
make the following script can automate importing certificate to glassfish
for further reading
https://community.letsencrypt.org/t/importing-letsencrypt-into-java-and-glassfish/9711
Now we import the certificates. Make the following script and save it as
yourscriptname.sh
to automate the process then run it with the commandif you need to change the keystore password
Use keytool command. If it doesn't work you might have to
cd
to the path where it's located in yourglassfish-install-dir/glassfish/domains/domain1/config
directory and run the command in that directory.After successfully importing the certs and restarting glassfish server, SSL worked with the installed web application but unfortunately I was not able to log into the glassfish admin console from the browser, though the
asadmin tool
still worked.solving unable to login to admin console after above changes
We need to add wget command to our script to download the most Recent CA file revisions per date of apperance from recent trusted ca revisions from mozilla
Add the following to the the
yourname.sh
script just above the commandsudo service glassfish stop
to fix the problem.I hope this helps someone cheers all!