2016-06-20 83 views
3

我试图通过TLS确保arduino pubsub客户端与mosquitto broker(运行在公共服务器上)之间的连接。确保arduino与TLS的蚊子连接

通常(在Windows等),我可以发布/订阅像bellow同时给予证书文件。 (证书和密钥文件在我的工作目录中)。

mosquitto_pub -h myhost.com -p 8883 -t "/test" -m "your secure message" --cafile ca.crt --cert client.crt --key client.key

mosquitto_sub -h myhost.com -p 8883 -t "/test" --cafile ca.crt --cert client.crt --key client.key

但是,有没有办法在Arduino的做到这一点?

+0

mosquitto客户端不在arduino上运行,你的意思是从这里的pubsub客户端http://pubsubclient.knolleary.net/? – hardillb

+1

你正在使用哪个硬件/ Arduino? Uno例如没有内存来运行完整的TLS。虽然它可能会被卸载到网络芯片上,如果使用像ESP8288这样的东西。 – njh

+0

我正在使用Sam3x8e芯片。谢谢! :) – Dileep

回答

1

不要以为有正常的arduino板加密availabe,至少不是我见过的。尽管有一些解决方法,你可以使用另一端没有加密(连接到arduino)的另一个代理,然后在另一端(连接到公共代理)加密。

另一种选择是使用在Linux上运行的板子,然后从arduino代码调用mosquitto命令。以下是Intel爱迪生主板的示例:https://software.intel.com/en-us/blogs/2015/04/06/using-edison-securely-connect-iot-sensor-to-the-internet-with-mqtt

+0

是的,我也搜索了四周,我无法找到一种方法。 :( :( 感谢你的回答! :) – Dileep