Overview

The HTTPS connector enables OpenJMS clients to connect to the OpenJMS server using secure HTTP.

This is typically used when firewall restrictions prevent the use of the RMI, TCP, and TCPS connectors.

Preparatory work

Before the HTTPS connector can be used, the Secure Socket Layer (SSL) needs to be initialised:

    System.setProperty("javax.net.ssl.trustStore", "<client-keystore>");
    System.setProperty("javax.net.ssl.keyStore", "<client.keystore>");
    System.setProperty("javax.net.ssl.keyStoreType", "jks");
    System.setProperty("javax.net.ssl.keyStorePassword", "<keystore-password>");
        

Where:

  • client-keystore specifies the path to the client certificate keystore.
  • keystore-password specifies the password of the client certificate keystore.

Using the HTTPS connector

Clients connect to the OpenJMS server via a webserver. To connect to OpenJMS via a webserver running on the local host, using the default HTTPS configuration, construct an InitialContext as follows:

    Hashtable properties = new Hashtable();
    properties.put(Context.INITIAL_CONTEXT_FACTORY, 
                   "org.exolab.jms.jndi.InitialContextFactory");
    properties.put(Context.PROVIDER_URL, "https://localhost:8081/");
    Context context = new InitialContext(properties);
        

The JNDI Context.PROVIDER_URL property above, has the format:

"http://<webserver-host>:<webserver-port>/"
        

Where:

  • webserver-host specifies the host of the webserver running the OpenJMS servlet.
  • webserver-port specifies the port that the OpenJMS servlet is listening on.

Administration using the HTTPS connector

To administer an OpenJMS server via the webserver running on the local host, using the default HTTPS configuration, construct a JmsAdminServerIfc as follows:

    String url = "https://localhost:8081/";
    JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
        

The URL argument has the same format as the Context.PROVIDER_URL described in Using the HTTPS connector