##### OpenJMS

- Overview
- Downloads
- Release Notes
- Getting Started
- User Guide
  - Using OpenJMS
  - Examples
  - Client JARS
  - Connectors
    - TCP
    - TCPS
    - RMI
    - HTTP
    - HTTPS
    - Embedded
  - Administration API
- Administrator Guide
- Developer Guide
- FAQ

##### Search OpenJMS

##### Project Documentation

- About
- Project Info
- Project Reports
- Development Process

##### Legend

- External Link
- Opens in a new window

## Overview

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

## Using the TCPS connector

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/");
        properties.put("org.exolab.jms.net.tcps.keyStore", "<keystore>");
        properties.put("org.exolab.jms.net.tcps.keyStorePassword", "<password>");
        properties.put("org.exolab.jms.net.tcps.trustStore", "<keystore>");
        Context context = new InitialContext(properties);

Where:

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

The Context.PROVIDER_URL property 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.

### Connection properties

The TCPS connector supports the following connection properties:

Name | Description
--- | ---
"org.exolab.jms.net.tcps.keyStore" | The path of the keystore to use. If not specified, indicates to use the default keystore. Synonymous with the "javax.net.ssl.keyStore" System property.
"org.exolab.jms.net.tcps.keyStorePassword" | The keystore password. If not specified, indicates to use the default password. Synonymous with the "javax.net.ssl.keyStorePassword" System property.
"org.exolab.jms.net.tcps.keyStoreType" | The keystore type. If not specified, defaults to "JKS". Synonymous with the "javax.net.ssl.keyStoreType" System property.
"org.exolab.jms.net.tcps.trustStore" | The path of the truststore to use. If not specified, indicates to use the default truststore. Synonymous with the "javax.net.ssl.trustStore" System property.
"org.exolab.jms.net.tcps.trustStorePassword" | The truststore password. If not specified, indicates to use the default password. Synonymous with the "javax.net.ssl.trustStorePassword" System property.
"org.exolab.jms.net.tcps.trustStoreType" | The truststore type. If not specified, defaults to "JKS". Synonymous with the "javax.net.ssl.trustStoreType" System property.

## 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:3035/";
        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