Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Question about publishing to an MQTT broker using TLS

I'm doing some testing using mosquitto, and have run across a really strange situation.

On an Ubuntu system with Mosquitto 1.4.5 installed, I can run the following command to the broker without any problems:

mosquitto_pub --cafile ./rootCA.pem --cert ./cert.pem --key private-key.pem \
-h "the-mqtt-broker.com" -p 8883 -q 0 -d \
-t "topic/test" \
-m "{\"msg\" : \"Goodbye, World\"}"

and the messages show up on the broker fine.

I've been trying to write a small test program doing the same thing (for inclusion in a larger test) and all of the "setup" (mosquitto, MQTT, TLS) appears to be getting sone correctly, but the connection never succeeds.

Looking at a network trace, it appears there is a client key exchange being done in the mosquitto_pub case, but not in my test code example.

I've looked through all my code (and the mosquitto_pub code) to see if I can spot what might be different. So far, I haven't seen anything. I would expect there might be something I'm not doing in the mosquitto TLS setup which would cause this to occur (as I would expect this handshake to occur at a pretty low level). Unfortunately, looking at the mosquitto_pub code and the mosquitto API documentation, I can't see anything which might be related.

So I'm wondering what I'm doing wrong? I expect it will be pretty simple; but I think I've been looking at the code too long :-)

- Mark


Back to the top