Red Hat AMQ 6
As of February 2025, Red Hat is no longer supporting Red Hat AMQ 6. If you are using AMQ 6, please upgrade: Migrating to AMQ 7.Chapter 3. Securing the Jetty HTTP Server
Abstract
You can configure the built-in Jetty HTTP server to use SSL/TLS security by adding the relevant configuration properties to the
etc/org.ops4j.pax.web.cfg
configuration file. In particular, you can add SSL/TLS security to the Fuse Management Console in this way.
Jetty server Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The JBoss A-MQ container is pre-configured with a Jetty server, which acts as a general-purpose HTTP server and HTTP servlet container. Through a single HTTP port (by default,
http://Host:8181
), the Jetty container can host multiple services, for example:
- Fuse Management Console (by default,
http://Host:8181/hawtio
) - Apache CXF Web services endpoints (if the host and port are left unspecified in the endpoint configuration)
- Some Apache Camel endpoints
If you use the default Jetty server for all of your HTTP endpoints, you can conveniently add SSL/TLS security to these HTTP endpoints by following the steps described here.
Create X.509 certificate and private key Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Before you can enable SSL, you must create an X.509 certificate and private key for the Web console. The certificate and private key must be in Java keystore format. For details of how to create a signed certificate and private key, see Appendix A, Managing Certificates.
Enabling SSL/TLS Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To enable SSL/TLS:
- Open
etc/org.ops4j.pax.web.cfg
in a text editor. - Disable the insecure HTTP port by adding the org.osgi.service.http.enabled and setting it to false as shown in Example 3.1, “Pax Web Property for Disabling the HTTP Port”.
Example 3.1. Pax Web Property for Disabling the HTTP Port
org.osgi.service.http.enabled=false
org.osgi.service.http.enabled=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enable the secure HTTPS port by adding the org.osgi.service.http.secure.enabled and setting it to
true
as shown in Example 3.2, “Pax Web Property for Enabling the HTTPS Port”.Example 3.2. Pax Web Property for Enabling the HTTPS Port
org.osgi.service.http.secure.enabled=true
org.osgi.service.http.secure.enabled=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - If you followed the preceding instructions, the
etc/org.ops4j.pax.web.cfg
file should now have the following contents:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
etc/jetty.xml
file and add the followingCall
element to configure the SSL connector for Jetty:Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThe preceding configuration explicitly disables the SSLv3 protocol, in order to safeguard against the Poodle vulnerability (CVE-2014-3566). For more details, see Disabling SSLv3 in JBoss Fuse 6.x and JBoss A-MQ 6.x. - Customize the properties of the
SslSocketConnector
instance defined in theetc/jetty.xml
file, as follows:port
- The secure HTTPS port number.
keyStore
- The location of the Java keystore file on the file system. Relative paths are resolved relative to the
KARAF_HOME
environment variable (by default, the install directory). keyStorePassword
- The store password that unlocks the Java keystore file.
keyManagerPassword
- The key password that decrypts the private key stored in the keystore (usually the same as the store password).
- Restart the JBoss A-MQ container, in order for the configuration changes to take effect.
Connect to the secure console Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
After configuring SSL security for the Jetty server in the Pax Web configuration file, you should be able to open the Fuse Management Console by browsing to the following URL:
Note
Remember to type the
https:
scheme, instead of http:
, in this URL.
Initially, the browser will warn you that you are using an untrusted certificate. Skip this warning and you will be presented with the login screen for the Fuse Management Console.
Advanced Jetty security configuration Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The Jetty server provides flexible and sophisticated options for configuring security. You can exploit these advanced options by editing the
etc/jetty.xml
file and configuring it as described in the Jetty security documentation: