How to configure Jetty on HTTPS

This is the simplest way to configure SSL on Jetty. I will demonstrate this using a self-signed certificate which is created using “keytool” utility shipped with JDK or JRE.

Prerequisites:

1. Jetty should be installed.  

To configure Jetty web server on HTTPS follow below mentioned steps in this blog:

 Step 1:

Create a self-signed certificate using keytool.


keytool -genkey -keyalg RSA -keystore jetty.crt -storepass password -alias jetty -keypass password -validity 3650

Step 2:


Move jetty.crt file to {Jetty_Home} i.e. {install_root}\jetty-6.1.20


Step 3:


Edit jetty.xml located at {install_root}\jetty-6.1.20\etc and add below given block:


 

 

 

8443 

30000  

\jetty.crt          

password 

password 

\jetty.crt 

password

 

 


Step 4:


Save jetty.xml.


Step 5:


Restart Jetty web server.


Step 6:


Try to access URL:  https://localhost:8443


And then, you are good to go.