broker.emqx.io に mqtts で接続するサンプルです。
サブスクライブ
mosquitto_sub -d -h broker.emqx.io \
-p 8883 --capath /etc/ssl/certs/ \
--topic example/testTopic
次でもオーケーです
mosquitto_sub -d -h broker.emqx.io -p 8883 \
--cafile /etc/ssl/certs/ca-certificates.crt \
--topic example/testTopic
パブリッシュ
message="Hello Mqtt "`date`
mosquitto_pub -d -m "${message}" \
-h broker.emqx.io \
-p 8883 --capath /etc/ssl/certs/ \
--topic example/testTopic
次でもオーケーです
message="Hello Mqtt "`date`
mosquitto_pub -d -m "${message}" \
-h broker.emqx.io -p 8883 \
--cafile /etc/ssl/certs/ca-certificates.crt \
--topic example/testTopic