1

I am having trouble connecting to a SonicMQ broker from my Java application.

this is my client code:

System.out.println("Connection setup started");
System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
System.setProperty("javax.net.ssl.keyStore", keyStoreFile.getAbsolutePath());
System.setProperty("javax.net.ssl.keyStorePassword","changeit");

ConnectionFactory connectionFactory = new progress.message.jclient.ConnectionFactory(args[0]);
Connection connection = connectionFactory.createConnection(args[1], args[2]);

On the last line i get "No trusted CA certificate is specified." notification and

javax.jms.JMSException: Unable to register trusted CA certificate(s) or trust decider to verify the broker certificate
at progress.message.jimpl.JMSExceptionUtil.createJMSException(JMSExceptionUtil.java:42)
at progress.message.jimpl.Connection.<init>(Connection.java:755)
at progress.message.jclient.ConnectionFactory.createConnection(ConnectionFactory.java:2055)
at hr.aduro.translatorclient.TranslatorClient.main(TranslatorClient.java:80)
Caused by: [4020] progress.message.net.ESocketConfigException: Unable to register trusted CA certificate(s) or trust decider to verify the broker certificate
at progress.message.net.ssl.ProgressSslSocket.<init>(ProgressSslSocket.java:89)
at progress.message.net.ssl.ProgressSslSocket.<init>(ProgressSslSocket.java:163)
at progress.message.net.ssl.ProgressSslSocketFactory.createProgressSocket(ProgressSslSocketFactory.java:240)
at progress.message.net.ProgressSocketFactory.createProgressSocket(ProgressSocketFactory.java:179)
at progress.message.zclient.Connection.openSocket(Connection.java:3640)
at progress.message.zclient.Connection.connectWithRecoveryOpt(Connection.java:752)
at progress.message.zclient.ReconnectHelper.connectAndChaseSingleFailoverRedirect(ReconnectHelper.java:534)
at progress.message.zclient.Connection.connect(Connection.java:1503)
at progress.message.jimpl.Connection.<init>(Connection.java:536)
... 2 more

NOTE: keyStoreFile is a p12 file in resources folder and contains a public certificate and private key pair

This puzzles me and I lost a whole day on this problem and still no resolution. I am aware that as soon as I state that my host uses SSL by passing the url as ssl://some-ip-address:port the connection factory will try and look for the CAs. The problem is I don't know where to specify what CA I am using.

ZooS
  • 658
  • 8
  • 18

0 Answers0