Quantcast

How to enable SSL over ActiveMQ using C client

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to enable SSL over ActiveMQ using C client

arjun13
I am trying to connect a C client with activeMQ using ssl.For this I created certificates using the following link https://github.com/rethab/php-stomp-cert-example/blob/master/README.md
Also I confiugured activeMQ with transport connectors as:
<transportConnector name="ssl" uri="mqtt+ssl://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> 

The portion of C client uisng SSL is as follows:
MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer;
ssl_opts.enableServerCertAuth = 0;
conn_opts.ssl = &ssl_opts;
conn_opts.ssl->keyStore = "/home/user/certs/client-chain.pem";
conn_opts.ssl->privateKeyPassword = "password";
conn_opts.ssl->enabledCipherSuites = "DEFAULT";
MQTTClient_setCallbacks(client, NULL, connlost, msgarrvd, delivered);
if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
{ printf("%d",rc); }
But when I connect a C client to activeMQ I get connect failed return code -1 error...Kindly help me to fix this issue
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable SSL over ActiveMQ using C client

tabish121@gmail.com
I'd recommend asking the Paho folks for instructions on using the Paho
client and debugging it

You can do some SSL level debug on the Java side of things, see these
docs for some tips on turning on debug.
http://activemq.apache.org/ssl-transport-reference.html
http://activemq.apache.org/how-do-i-use-ssl.html

On 01/06/2017 04:27 AM, arjun13 wrote:

> I am trying to connect a C client with activeMQ using ssl.For this I created
> certificates using the following link
> https://github.com/rethab/php-stomp-cert-example/blob/master/README.md
> <http://https://github.com/rethab/php-stomp-cert-example/blob/master/README.md>
> Also I confiugured activeMQ with transport connectors as:
> <transportConnector name="ssl"
> uri="mqtt+ssl://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
>
> The portion of C client uisng SSL is as follows:
> MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer;
> ssl_opts.enableServerCertAuth = 0;
> conn_opts.ssl = &ssl_opts;
> conn_opts.ssl->keyStore = "/home/user/certs/client-chain.pem";
> conn_opts.ssl->privateKeyPassword = "password";
> conn_opts.ssl->enabledCipherSuites = "DEFAULT";
> MQTTClient_setCallbacks(client, NULL, connlost, msgarrvd, delivered);
> if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
> { printf("%d",rc); }
> But when I connect a C client to activeMQ I get connect failed return code
> -1 error...Kindly help me to fix this issue
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-enable-SSL-over-ActiveMQ-using-C-client-tp4720869.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable SSL over ActiveMQ using C client

arjun13
Hi Tim Bish ,
        I read http://activemq.apache.org/how-do-i-use-ssl.html.My configuration seems to be correct.I can connect java client to broker using ssl certificate.I am trying with C client.Since it takes certificate in .pem format I want to convert  I followed the instruction given in https://github.com/rethab/php-stomp-cert-example/blob/master/README.md..But with this client certificate I cant connect to broker.I think there is some error in creating certificate.Can you please check to see whether my certificate generation is correct or not.
Loading...