ES 50 connection with SSL

Hi Kevin,
Firstly to connect to an SSL enabled broker through a BrokerClient/BrokerAdminClient you have to use the BrokerConnectionDescriptor class to set the SSL related parameters.

I see from your code above you are passing null to the BrokerConnectionDescriptor parameter in the BrokerAdminClient constructor.

The sample code to connect to the SSL enabled broker using BrokerClient/BrokerAdminClient is as below:

BrokerAdminClient c;
BrokerConnectionDescriptor bcd = null ;

bcd = new BrokerConnectionDescriptor();
bcd.setAccessLabelHint(“”);
bcd.setAutomaticReconnect(true);
bcd.setConnectionShare(false);
bcd.setSSLCertificate(pathTosslCertificateFile,sslPassword,sslDistinguishedName);
bcd.setSSLEncrypted(false);
bcd.setStateShare(false);

c = new BrokerAdminClient(broker_host, broker_name, null,
client_group, “My Broker Monitor”,bcd);

For a non-SSL connection bcd can be null.

Thanks
sivaram

Hi

When you want to use BrokerConnectionDescriptor in your programs, you will have security problems, with a message like :

“Security Error (114-1442): Secure sockets are not supported with this version of the classes.”

To resolve this problem, you have to allow wMe to load the SSL library : awssl40jn.dll (for windows) or libawssl40jn.so (for Unix-Linux)

This will be done simply with adding this java option when you run your program : -Djava.library.path=%LIBPATH%

where %LIBPATH% correspond to the folder containing the library.

Karim

Thanks, that’s exactly what I needed. It works great!!

Best Regards, …Kevin

setSSLCertificate throws Null Ptr Exception. Help appreciated!!

we are running JDK 1.2.2 with Jaguar EA server, we have the native library awssl50jn.dll (for windows 2000) in the library path. However we are getting a NullPointer exception on the call

bcd.setSSLCertificate(pathTosslCertificateFile,sslPassword,sslDistinguishedName);

The above line is throwing a Null Ptr Exception (bcd is not null)

Thanks in advance,
Mohan