Hi,

 

I am trying out to use proton-j 0.7 to communicate with a AMQP server that
always uses SSL encryption. On order to do so, we received a pem file from
the organisation operating the broker.

While the proton-c port uses this file directly and worked like a charm, in
Java it is not working with SSL at all for me. 

 

I tried the following:

/// ==== 8< ==== ///

if (addresses.size() < 1) {

 
this.addresses.add("amqps://some_ip:some_port/queue://some_queue_name");

            this.addresses.add("amqps:// some_ip:some_port
/topic://some_topic_name");

        }

/// ==== 8< ==== ///

messenger.start();

 

            messenger.setCertificate("path_2_file.pem");

            messenger.setPrivateKey("path_2_file.pem ");

 

            for (String address : addresses) {

                messenger.subscribe(address);

            }

           messenger.recv();

/// ==== 8< ==== ///

 

As soon as the function messenger.recv(); is called, the application is
searching for classes from org. bouncycastle, which I added in the version
1.47 in maven, because the desired Functions are no longer available in
later versions.

 

Afterwards (as the bouncycastle stuff is available) I always receive the
following error:

 

org.apache.qpid.proton.engine.TransportException:
org.apache.qpid.proton.engine.TransportException: File path_2_file.pem does
not provide a object of the required type. Read an object of class
org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateCrtKey whilst
expecting an implementation of one of the following  : [class
java.security.cert.Certificate]

 

What needs to be done, to have this working with the same pem files as in C?
Should I convert the file to another format? 

 

Thanks an kind regards

Frank

Reply via email to