Though some containers support HTTPS, the way it is configured is not yet uniform across them.
Jetty 10.x onwards
The Jetty container supports HTTPS, both as a complement to the HTTP connector or as an HTTPS-only connector.
To add HTTPS support, in addition to the HTTP support:
- Set the property
JettyPropertySet.MODULES
to include thehttps
module (in addition to thehttp
module) - Set the properties
JettyPropertySet.CONNECTOR_KEY_STORE_FILE
andJettyPropertySet.CONNECTOR_KEY_STORE_PASSWORD
with the relevant details - Optionally,
JettyPropertySet.CONNECTOR_HTTPS_PORT
allows you to change the HTTPS port (default is9443
)
To only have HTTPS (and no HTTP) configured:
- Set the property
JettyPropertySet.MODULES
to have thehttps
module instead of thehttp
module - Set the property
GeneralPropertySet.PROTOCOL
tohttps
- Set the properties
JettyPropertySet.CONNECTOR_KEY_STORE_FILE
andJettyPropertySet.CONNECTOR_KEY_STORE_PASSWORD
with the relevant details - Make sure you set both
ServletPropertySet.PORT
andJettyPropertySet.CONNECTOR_HTTPS_PORT
to the same port number
Tomcat 6.x onwards and TomEE
The Tomcat 6.x onwards and TomEE containers can have HTTPS activated, in addition to HTTP. To have HTTPS configured:
- Set the properties
TomcatPropertySet.CONNECTOR_KEY_STORE_FILE
andTomcatPropertySet.CONNECTOR_KEY_STORE_PASSWORD
with the relevant details - Optionally,
TomcatPropertySet.CONNECTOR_HTTPS_PORT
allows you to change the HTTPS port (default is8443
)