Sample certificates are located in the EMS_HOME/samples/certs directory. EMS is installed with some sample certificates and private keys that are used by the sample configuration files.
The sample certificates include:
- A root, self-signed certificate and corresponding private keys in encrypted PEM and PKCS8 formats.
server_root.cert.pem
server_root.key.pem
server_root.key.p8
- A server certificate and corresponding private keys in encrypted PEM and PKCS8 formats. This certificate is issued by server_root.cert.pem and is used by the server.
server.cert.pem
server.key.pem
server.key.p8
-A root, self-signed certificate and corresponding private key in encrypted PEM and PKCS8 formats.
client_root.cert.pem
client_root.key.pem
client_root.key.p8
- A client certificate and corresponding private key in encrypted PEM and PKCS8 formats. This certificate is issued by client_root.cert.pem and is used by the clients.
client.cert.pem
client.key.pem
client.key.p8
- A PKCS12 file that includes the client.cert.pem client certificate, the client.key.pem client private key and the client_root.cert.pem issuer certificate.
client_identity.p12
Using these certificates, we can run the sample programs as below.
- Compile the programs by following the steps in readme.txt in EMS_HOME/samples/java directory
- Start the EMS server using the tibemsdssl.conf in EMS_HOME/samples/config directory
- Run the program tibjmsSSL .java as shown below.
java tibjmsSSL -server <EMS SSL url> -user admin -password "" -ssl_identity <EMS_HOME>/samples/certs/client_identity.p12 -ssl_password password -ssl_trusted <EMS_HOME>/samples/certs/server_root.cert.pem -ssl_hostname serverThis program connects to the EMS server over SSL and publishes and consumes three messages on topic topic.sample.
We can check all the command line options with the following:
java tibjmsSSL -helpWe can run the other sample programs such as tibjmsMsgProducer.java, tibjmsMsgConsumer.java, tibjmsMsgProducerPerf.java and tibjmsMsgConsumerPerf.java in a similar way.