You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "jorge.medra" <jo...@gmail.com> on 2013/01/16 06:07:49 UTC

SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX

Hi 

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"
             "?transport.acceptInvalidBrokerCert=true)";

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


...

    void runConsumer() {
        
        try {
            
           decaf::lang::System::setProperty( "javax.net.ssl.keyStore",
"/Users/jorgemedra/Documents/TKQ/certificados/https/demo/demo.pem");
            
            
            // 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 );
            }
            

            //connection->setExceptionListener(this);
            amqConnection->setExceptionListener(this);

            //connection->start();
            amqConnection->start();  // *** HERE IS WHEN THE PROGRMA
FREEZING
            
        
            
            // Create a Session
            if( clientAck ) {
                session = amqConnection->createSession(
Session::CLIENT_ACKNOWLEDGE );
            } else {
                session = amqConnection->createSession(
Session::AUTO_ACKNOWLEDGE );
            }
            
            // 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
Queue
            consumer = session->createConsumer( destination );
            consumer->setMessageListener( this );
            
        } catch (CMSException& e) {
            e.printStackTrace();
        }
    }


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

amqConnection->start();


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?

Thanks.





--
View this message in context: http://activemq.2283324.n4.nabble.com/SSL-Connection-with-ActiveMQ-CPP-3-4-5-and-3-5-0-in-OSX-tp4661808.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX

Posted by Timothy Bish <ta...@gmail.com>.
On Wed, 2013-01-16 at 08:40 -0800, jorge.medra wrote: 
> The process that I follow to create the KeyStore, for activemq server, and
> PEM certified was:
> 
> 1.- Create the Keystore with java keytools
> 
> keytool -genkey -alias demo.cert -keystore demo.keystore -keyalg RSA
> 
> 2.- Export Cert File, with keytools
> 
> keytool -export -alias demo.cert -keystore demo.keystore -file demo.cert
> 
> 3.- Create PEM file
> 
> openssl x509 -inform der -in demo.cert -out demo.pem
> 
> This PEM file is used in c++ client.
> 
> What cold i be missing??
> 
> 

Have you read through this?
http://timbish.blogspot.com/2010/04/ussing-ssl-in-nmsactivemq.html

What's the broker config?


> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/SSL-Connection-with-ActiveMQ-CPP-3-4-5-and-3-5-0-in-OSX-tp4661808p4661832.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com 
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX

Posted by "jorge.medra" <jo...@gmail.com>.
The process that I follow to create the KeyStore, for activemq server, and
PEM certified was:

1.- Create the Keystore with java keytools

keytool -genkey -alias demo.cert -keystore demo.keystore -keyalg RSA

2.- Export Cert File, with keytools

keytool -export -alias demo.cert -keystore demo.keystore -file demo.cert

3.- Create PEM file

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

This PEM file is used in c++ client.

What cold i be missing??




--
View this message in context: http://activemq.2283324.n4.nabble.com/SSL-Connection-with-ActiveMQ-CPP-3-4-5-and-3-5-0-in-OSX-tp4661808p4661832.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX

Posted by Timothy Bish <ta...@gmail.com>.
On Wed, 2013-01-16 at 08:22 -0800, jorge.medra wrote: 
> Hi 
> 
> This is the error that ActiveMQ Server register at the moment client wants
> making connection:
> 
> Whit failover
> 
> 2013-01-16 09:51:45,307 | INFO  | Started
> SelectChannelConnector@0.0.0.0:8161 |
> org.eclipse.jetty.server.AbstractConnector | main
> 2013-01-16 09:52:01,560 | WARN  | Transport Connection to:
> tcp://192.168.100.168:49290 failed: javax.net.ssl.SSLHandshakeException:
> Received fatal alert: unknown_ca |
> org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
> Transport: ssl:///192.168.100.168:49290
> 2013-01-16 09:52:01,564 | ERROR | Could not accept connection from
> tcp://192.168.100.168:49290: javax.net.ssl.SSLHandshakeException: Received
> fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
> ActiveMQ Task-1
> 2013-01-16 09:52:16,573 | WARN  | Transport Connection to:
> tcp://192.168.100.168:49291 failed: javax.net.ssl.SSLHandshakeException:
> Received fatal alert: unknown_ca |
> org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
> Transport: ssl:///192.168.100.168:49291
> 2013-01-16 09:52:16,574 | ERROR | Could not accept connection from
> tcp://192.168.100.168:49291: javax.net.ssl.SSLHandshakeException: Received
> fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
> ActiveMQ Task-1
> 2013-01-16 09:52:31,607 | WARN  | Transport Connection to:
> tcp://192.168.100.168:49292 failed: javax.net.ssl.SSLHandshakeException:
> Received fatal alert: unknown_ca |
> org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
> Transport: ssl:///192.168.100.168:49292
> 2013-01-16 09:52:31,607 | ERROR | Could not accept connection from
> tcp://192.168.100.168:49292: javax.net.ssl.SSLHandshakeException: Received
> fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
> ActiveMQ Task-1
> 
> Whitout failover:
> 
> 2013-01-16 10:17:02,524 | INFO  | Started
> SelectChannelConnector@0.0.0.0:8161 |
> org.eclipse.jetty.server.AbstractConnector | main
> 2013-01-16 10:17:36,135 | WARN  | Transport Connection to:
> tcp://192.168.100.168:49400 failed: javax.net.ssl.SSLHandshakeException:
> Received fatal alert: unknown_ca |
> org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
> Transport: ssl:///192.168.100.168:49400
> 2013-01-16 10:17:36,137 | ERROR | Could not accept connection from
> tcp://192.168.100.168:49400: javax.net.ssl.SSLHandshakeException: Received
> fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
> ActiveMQ Task-1
> 
> 
> In both case the error is the same and,  as I can see, the api is trying to
> connect several times and that could be the reason that the API is freezing
> in line amqConnection->start().
> 
> 
> 

A freeze in start is expected if the client cannot connect and you are
using failover, the client is trying to connect so it can't proceed past
start().

The problem appears to be that your broker doesn't have the client
certificate in its trust store. 

> 
> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/SSL-Connection-with-ActiveMQ-CPP-3-4-5-and-3-5-0-in-OSX-tp4661808p4661827.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com 
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX

Posted by "jorge.medra" <jo...@gmail.com>.
Hi 

This is the error that ActiveMQ Server register at the moment client wants
making connection:

Whit failover

2013-01-16 09:51:45,307 | INFO  | Started
SelectChannelConnector@0.0.0.0:8161 |
org.eclipse.jetty.server.AbstractConnector | main
2013-01-16 09:52:01,560 | WARN  | Transport Connection to:
tcp://192.168.100.168:49290 failed: javax.net.ssl.SSLHandshakeException:
Received fatal alert: unknown_ca |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: ssl:///192.168.100.168:49290
2013-01-16 09:52:01,564 | ERROR | Could not accept connection from
tcp://192.168.100.168:49290: javax.net.ssl.SSLHandshakeException: Received
fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
ActiveMQ Task-1
2013-01-16 09:52:16,573 | WARN  | Transport Connection to:
tcp://192.168.100.168:49291 failed: javax.net.ssl.SSLHandshakeException:
Received fatal alert: unknown_ca |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: ssl:///192.168.100.168:49291
2013-01-16 09:52:16,574 | ERROR | Could not accept connection from
tcp://192.168.100.168:49291: javax.net.ssl.SSLHandshakeException: Received
fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
ActiveMQ Task-1
2013-01-16 09:52:31,607 | WARN  | Transport Connection to:
tcp://192.168.100.168:49292 failed: javax.net.ssl.SSLHandshakeException:
Received fatal alert: unknown_ca |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: ssl:///192.168.100.168:49292
2013-01-16 09:52:31,607 | ERROR | Could not accept connection from
tcp://192.168.100.168:49292: javax.net.ssl.SSLHandshakeException: Received
fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
ActiveMQ Task-1

Whitout failover:

2013-01-16 10:17:02,524 | INFO  | Started
SelectChannelConnector@0.0.0.0:8161 |
org.eclipse.jetty.server.AbstractConnector | main
2013-01-16 10:17:36,135 | WARN  | Transport Connection to:
tcp://192.168.100.168:49400 failed: javax.net.ssl.SSLHandshakeException:
Received fatal alert: unknown_ca |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: ssl:///192.168.100.168:49400
2013-01-16 10:17:36,137 | ERROR | Could not accept connection from
tcp://192.168.100.168:49400: javax.net.ssl.SSLHandshakeException: Received
fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
ActiveMQ Task-1


In both case the error is the same and,  as I can see, the api is trying to
connect several times and that could be the reason that the API is freezing
in line amqConnection->start().






--
View this message in context: http://activemq.2283324.n4.nabble.com/SSL-Connection-with-ActiveMQ-CPP-3-4-5-and-3-5-0-in-OSX-tp4661808p4661827.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX

Posted by Timothy Bish <ta...@gmail.com>.
On Wed, 2013-01-16 at 08:30 -0800, jorge.medra wrote:
> javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca
> |

That's the key, you're broker doesn't know about the client's cert.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com 
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX

Posted by "jorge.medra" <jo...@gmail.com>.
I set the log ob DEBUG level,  and the log is this:

2013-01-16 10:27:43,123 | DEBUG | starting null/null |
org.eclipse.jetty.util.component.AbstractLifeCycle | main
2013-01-16 10:27:43,125 | DEBUG | STARTED PooledBuffers
[0/1024@6144,0/1024@16384,0/1024@-]/PooledBuffers
[0/1024@6144,0/1024@32768,0/1024@-] |
org.eclipse.jetty.util.component.AbstractLifeCycle | main
2013-01-16 10:27:43,126 | DEBUG | starting
org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager@228917a2
| org.eclipse.jetty.util.component.AbstractLifeCycle | main
2013-01-16 10:27:43,134 | DEBUG | STARTED
org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager@228917a2
| org.eclipse.jetty.util.component.AbstractLifeCycle | main
2013-01-16 10:27:43,135 | DEBUG | Starting Thread[qtp1355224018-27
Selector0,5,main] on org.eclipse.jetty.io.nio.SelectorManager$1@68b57af1 |
org.eclipse.jetty.io.nio | qtp1355224018-27 Selector0
2013-01-16 10:27:43,135 | DEBUG | Starting Thread[qtp1355224018-28
Selector1,5,main] on org.eclipse.jetty.io.nio.SelectorManager$1@1ae3e881 |
org.eclipse.jetty.io.nio | qtp1355224018-28 Selector1
2013-01-16 10:27:43,135 | INFO  | Started
SelectChannelConnector@0.0.0.0:8161 |
org.eclipse.jetty.server.AbstractConnector | main
2013-01-16 10:27:43,135 | DEBUG | STARTED
SelectChannelConnector@0.0.0.0:8161 |
org.eclipse.jetty.util.component.AbstractLifeCycle | main
2013-01-16 10:27:43,135 | DEBUG | STARTED
org.eclipse.jetty.server.Server@75f2edd2 |
org.eclipse.jetty.util.component.AbstractLifeCycle | main
2013-01-16 10:27:43,135 | DEBUG | Unable to locate LifecycleProcessor with
name 'lifecycleProcessor': using default
[org.springframework.context.support.DefaultLifecycleProcessor@41d47f59] |
org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2013-01-16 10:27:45,177 | DEBUG | Sending: WireFormatInfo { version=9,
properties={MaxFrameSize=104857600, CacheSize=1024, CacheEnabled=true,
SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000,
TcpNoDelayEnabled=true, MaxInactivityDuration=30000,
TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
| org.apache.activemq.transport.WireFormatNegotiator | ActiveMQ Task-1
2013-01-16 10:27:45,201 | DEBUG | Calling the delayed stop() after start()
Transport Connection to: tcp://192.168.100.168:49468 |
org.apache.activemq.broker.TransportConnection | ActiveMQ Task-1
2013-01-16 10:27:45,201 | DEBUG | Transport Connection to:
tcp://192.168.100.168:49468 failed: javax.net.ssl.SSLHandshakeException:
Received fatal alert: unknown_ca |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: ssl:///192.168.100.168:49468
javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca
	at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
	at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1839)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1019)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1203)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:818)
	at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
	at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
	at
org.apache.activemq.transport.tcp.TcpTransport$2.fill(TcpTransport.java:602)
	at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
	at
org.apache.activemq.transport.tcp.TcpTransport$2.read(TcpTransport.java:587)
	at java.io.DataInputStream.readInt(DataInputStream.java:370)
	at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:275)
	at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:229)
	at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:221)
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:204)
	at java.lang.Thread.run(Thread.java:680)
2013-01-16 10:27:45,205 | DEBUG | Stopping connection:
tcp://192.168.100.168:49468 | org.apache.activemq.broker.TransportConnection
| ActiveMQ Task-2
2013-01-16 10:27:45,205 | DEBUG | Stopping transport
ssl:///192.168.100.168:49468 |
org.apache.activemq.transport.tcp.TcpTransport | ActiveMQ Task-2
2013-01-16 10:27:45,206 | DEBUG | Stopped transport:
tcp://192.168.100.168:49468 | org.apache.activemq.broker.TransportConnection
| ActiveMQ Task-2
2013-01-16 10:27:45,206 | DEBUG | Connection Stopped:
tcp://192.168.100.168:49468 | org.apache.activemq.broker.TransportConnection
| ActiveMQ Task-2
2013-01-16 10:27:45,206 | ERROR | Could not accept connection from
tcp://192.168.100.168:49468: javax.net.ssl.SSLHandshakeException: Received
fatal alert: unknown_ca | org.apache.activemq.broker.TransportConnector |
ActiveMQ Task-1
2013-01-16 10:27:45,206 | DEBUG | Reason:
javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca |
org.apache.activemq.broker.TransportConnector | ActiveMQ Task-1
javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca
	at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
	at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1839)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1019)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1203)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:818)
	at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
	at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
	at
org.apache.activemq.transport.tcp.TcpTransport$2.fill(TcpTransport.java:602)
	at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
	at
org.apache.activemq.transport.tcp.TcpTransport$2.read(TcpTransport.java:587)
	at java.io.DataInputStream.readInt(DataInputStream.java:370)
	at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:275)
	at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:229)
	at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:221)
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:204)
	at java.lang.Thread.run(Thread.java:680)
2013-01-16 10:27:47,170 | DEBUG | Checkpoint started. |
org.apache.activemq.store.kahadb.MessageDatabase | ActiveMQ Journal
Checkpoint Worker
2013-01-16 10:27:47,174 | DEBUG | Checkpoint done. |
org.apache.activemq.store.kahadb.MessageDatabase | ActiveMQ Journal
Checkpoint Worker
2013-01-16 10:27:47,867 | DEBUG | Cleaning up expired web clients. |
org.apache.activemq.web.MessageListenerServlet | Timer-0
2013-01-16 10:27:48,057 | DEBUG | Cleaning up expired web clients. |
org.apache.activemq.web.MessageListenerServlet | Timer-1
2013-01-16 10:27:52,184 | DEBUG | Checkpoint started. |
org.apache.activemq.store.kahadb.MessageDatabase | ActiveMQ Journal
Checkpoint Worker
2013-01-16 10:27:52,189 | DEBUG | Checkpoint done. |
org.apache.activemq.store.kahadb.MessageDatabase | ActiveMQ Journal
Checkpoint Worker
2013-01-16 10:27:57,199 | DEBUG | Checkpoint started. |
org.apache.activemq.store.kahadb.MessageDatabase | ActiveMQ Journal
Checkpoint Worker
2013-01-16 10:27:57,205 | DEBUG | Checkpoint done. |
org.apache.activemq.store.kahadb.MessageDatabase | ActiveMQ Journal
Checkpoint Worker




I hope this could be helpfully.





--
View this message in context: http://activemq.2283324.n4.nabble.com/SSL-Connection-with-ActiveMQ-CPP-3-4-5-and-3-5-0-in-OSX-tp4661808p4661829.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: SSL Connection with ActiveMQ-CPP 3.4.5 and 3.5.0 in OSX

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2013-01-15 at 21:07 -0800, jorge.medra wrote: 
> Hi 
> 
> 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.
> 

This is usually a sing that the client can't connect for some reason,
either the broker config doesn't match up with the connection URI or the
broker isn't reachable.  You can remove the failover bit and see if
there's a more specific exception being thrown, or check the broker logs
to see if there's any useful information there. 

> Here the code to create the connection:
> 
> 
> 
> std::string brokerURI = "failover:(ssl://MacBook-Pro-de-Jorge.local:61617"
>              "?transport.acceptInvalidBrokerCert=true)";
> 
>  // Create the consumer
>  SimpleAsyncConsumer consumer( brokerURI, destURI, useTopics, clientAck );
>     
>  // Start it up and it will listen forever.
>  consumer.runConsumer();
> 
> 
> ...
> 
>     void runConsumer() {
>         
>         try {
>             
>            decaf::lang::System::setProperty( "javax.net.ssl.keyStore",
> "/Users/jorgemedra/Documents/TKQ/certificados/https/demo/demo.pem");
>             
>             
>             // 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 );
>             }
>             
> 
>             //connection->setExceptionListener(this);
>             amqConnection->setExceptionListener(this);
> 
>             //connection->start();
>             amqConnection->start();  // *** HERE IS WHEN THE PROGRMA
> FREEZING
>             
>         
>             
>             // Create a Session
>             if( clientAck ) {
>                 session = amqConnection->createSession(
> Session::CLIENT_ACKNOWLEDGE );
>             } else {
>                 session = amqConnection->createSession(
> Session::AUTO_ACKNOWLEDGE );
>             }
>             
>             // 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
> Queue
>             consumer = session->createConsumer( destination );
>             consumer->setMessageListener( this );
>             
>         } catch (CMSException& e) {
>             e.printStackTrace();
>         }
>     }
> 
> 
> At the moment of debug this sample the program is freezing into the line 
> 
> amqConnection->start();
> 
> 
> 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?
> 
> Thanks.
> 
> 
> 
> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/SSL-Connection-with-ActiveMQ-CPP-3-4-5-and-3-5-0-in-OSX-tp4661808.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com 
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/