activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jorge.medra" <>
Subject SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX
Date Wed, 16 Jan 2013 05:07:49 GMT

I've been working fine wit active ActiveMQ and Java applications using SSL
connection but i need to create another client in C++ over OSX. I compiled
the api with the option --with-openssl, at the momento start of threat it
doesnt work. If i change the transport layer to TCP its worked fine.

Here the code to create the connection:

std::string brokerURI = "failover:(ssl://MacBook-Pro-de-Jorge.local:61617"

 // Create the consumer
 SimpleAsyncConsumer consumer( brokerURI, destURI, useTopics, clientAck );
 // Start it up and it will listen forever.


    void runConsumer() {
        try {
           decaf::lang::System::setProperty( "",
            // Create a ConnectionFactory
            ActiveMQConnectionFactory* connectionFactory = new
ActiveMQConnectionFactory( brokerURI );

            // Create a Connection
            connection = connectionFactory->createConnection();
            delete connectionFactory;
            ActiveMQConnection* amqConnection =
dynamic_cast<ActiveMQConnection*>( connection );
            if( amqConnection != NULL ) {
                amqConnection->addTransportListener( this );


            amqConnection->start();  // *** HERE IS WHEN THE PROGRMA
            // Create a Session
            if( clientAck ) {
                session = amqConnection->createSession(
            } else {
                session = amqConnection->createSession(
            // Create the destination (Topic or Queue)
            if( useTopic ) {
                destination = session->createTopic( destURI );
            } else {
                destination = session->createQueue( destURI );
            // Create a MessageConsumer from the Session to the Topic or
            consumer = session->createConsumer( destination );
            consumer->setMessageListener( this );
        } catch (CMSException& e) {

At the moment of debug this sample the program is freezing into the line 


The certifie that i'm using is in pem format, and i created this since a
certified that was imported from a browser. I created this wiht open ssl, as
you can see:

          openssl x509 -inform der -in demo.cert -out demo.pem

I have the same problem in ActiveMQ-Cpp V3.4.5 and 4.5.0

Cloud someone help me to make connection with SSL? what did i do wrong?


View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message