启用 TLS 的 mosquitto_sub [英] mosquitto_sub with TLS enabled

查看:124
本文介绍了启用 TLS 的 mosquitto_sub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 MQTT 的新手,遇到了一个令人沮丧的问题.

I am new to MQTT and I have a frustrating problem.

我一直在使用MQTT.fx订阅一个主题;我已经设置了:

I have been using MQTT.fx to subscribe to a topic; I have set the:

  • 经纪人地址
  • 端口
  • 客户 ID
  • 启用 SSL/TLS
  • 主题

这很有效,但是我想使用 mosquitto_sub.我正在尝试通过以下方式订阅同一主题:

This works well, however I would like to use mosquitto_sub. I am attempting to subscribe to the same topic in the following way:

mosquitto_sub -h  host -p 8883 -t topic -i client id

这对我不起作用.我在 Ubuntu VM 上使用它.
我的观察力告诉我应该启用 TLS,但是我不太确定如何做到这一点,我已经塞满了证书并以多种方式启用了 TLS,但没有得到正确的组合.我知道这是必需的,就像我取消选中 MQTT.fx 中的 SSL/TLS 框一样,我无法连接.

This is not working for me. I am using it on a Ubuntu VM.
My powers of observation tell me that I should enable TLS, however I'm not quite sure how to do that, I have stuffed around with certificates and enabling TLS in may ways but have not got the right combo. I know it is required as if I uncheck the SSL/TLS box in MQTT.fx I am unable to connect.

我真的很想用 mosquitto 复制我在 MQTT.fx 中的内容.

I would really like to replicate what I have in MQTT.fx with mosquitto.

推荐答案

在 mosquitto_sub 命令中,使用 --capath 参数指向/etc/ssl/certs.它需要一个指向受信任证书的指针.

In the mosquitto_sub command, use the --capath argument to point to /etc/ssl/certs. It needs a pointer to the trusted certificates.

这篇关于启用 TLS 的 mosquitto_sub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆