Overview

The TCPS connector enables OpenJMS clients to connect to the OpenJMS server using SSL (Secure Socket Layer).

Using the TCPS connector

Before the TCPS 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.

To connect to an OpenJMS server running on the local host, using the default TCPS 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, "tcps://localhost:3035/");
    Context context = new InitialContext(properties);
        

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

"tcps://<server-host>:<jndi-port>/"
        

Where:

  • server-host specifies the host that the OpenJMS server is running on.
  • jndi-port specifies the port that the embedded JNDI provider is listening on.

Administration using the TCPS connector

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

    String url = "tcps://localhost:3031/";
    JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
        

The URL argument has the format:

"tcps://<server-host>:<server-port>/"
        

Where:

  • server-host specifies the host that the OpenJMS server is running on.
  • server-port specifies the port that the OpenJMS server is listening on.

See Also

For more information on the client certificate keystore, see Creating OpenJMS client certificate keystores