How to do it...

  1. To do this task, you need to access the GlassFish remote command-line interface (CLI). You can do it by going to this path:

$GLASSFISH_HOME/bin

  1. Once you are there, execute the following command:
./asadmin
  1. When the prompt is ready, you can execute this command:
create-ssl --type http-listener --certname cookbookCert http-listener-1
  1. Then you can restart the server and your http-listener-1 will work with SSL. If you want to drop SSL from the listener, just go back to the prompt and execute this command:
delete-ssl --type http-listener http-listener-1

Get Java EE 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.