paho mqtt C client with TLS

1,595 views
Skip to first unread message

Vladimir A

unread,
Nov 30, 2016, 8:55:14 AM11/30/16
to MQTT
Hello all,

I spent couple hours trying to subscribe to MQTT broker with TLS. And I could not do that.

I got paho.mqtt.c from git repo and build it with make. After that I wrote simple application. Example seems simple: init MQTTClient_SSLOptions structure, specify certificated and key and connect to host. But connection fails.

I try to run test3 from paho.mqtt.c/build/output/test directory, and I see asserts and messages like that "ssl://m2m.eclipse.org is not a valid IP address
Assertion failed, file src/../test/test3.c, line 666, description: Good rc from connect".

Can anybody who worked with paho.mqtt.c and TLS tell me if paho.mqtt.c works with TLS? If yes what should I do to start using it?

Paul Fremantle

unread,
Nov 30, 2016, 9:48:54 AM11/30/16
to mq...@googlegroups.com
It could be the broker too. I'd get a command line client working first and then try your code with the same certs. I also find the open ssl rest correct useful. Paul
--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+unsubscribe@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.


--
Paul Fremantle
Doctoral Researcher, University of Portsmouth, School of Computing
Visiting Scientist, Institute of the Architecture of Application Systems, Stuttgart
Visiting Lecturer, Software Engineering Programme, Oxford University
Co-Founder, WSO2
Apache Member and Committer
twitter: pzfreo / skype: paulfremantle / blog: http://pzf.fremantle.org

Vladimir A

unread,
Nov 30, 2016, 10:38:37 AM11/30/16
to MQTT
I already have thied console mosquitto_sub client and libmosquitto c client with TLS certificates and key. Both work fine. Now I am trying to work with paho library. Samples from "paho.mqtt.c/build/output/samples" don't use TLS


среда, 30 ноября 2016 г., 17:48:54 UTC+3 пользователь Paul Fremantle написал:

Paul Fremantle

unread,
Nov 30, 2016, 1:26:31 PM11/30/16
to mq...@googlegroups.com
Ok... I'm afraid I can't help anymore.... I don't use the C client myself. I've used other clients successfully.

Paul

Vladimir A

unread,
Dec 1, 2016, 8:26:39 AM12/1/16
to MQTT
I recompiled paho library using make (before that I used cmake to build library) and I got it working. Probably build was incomplete or something like that


среда, 30 ноября 2016 г., 21:26:31 UTC+3 пользователь Paul Fremantle написал:
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.

To post to this group, send email to mq...@googlegroups.com.
Visit this group at https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.

Gianluca Mattiroli

unread,
Mar 8, 2017, 6:56:04 AM3/8/17
to MQTT

Could you share your modified Makefile ?
Thanks,
Gianluca

Chetan Gomase

unread,
Aug 1, 2017, 7:04:10 AM8/1/17
to MQTT
Hi Vladmir,

Please share your sample application if possible.
Reply all
Reply to author
Forward
0 new messages