【发布时间】:2017-10-13 14:18:33
【问题描述】:
我想建立一个从 ESP8266 到 mosquitto MQTT 服务器的 TLS 连接。
我将 Adafruit example INO 与 WiFiClientSecure 一起使用,它成功连接到我的 Wifi 与其他 MQTT 服务器(例如 iot.eclipse.org:8883)一起工作正常
就在我尝试连接到我自己的 mosquitto 实例时,它失败了 在 mosquitto 日志中显示:
OpenSSL 错误:错误:1408A10B:SSL 例程:SSL3_GET_CLIENT_HELLO:版本号错误
我的 mosquitto.conf 看起来像这样
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
allow_anonymous false
listener 51883
password_file /etc/mosquitto/pwfile
conf.d 包含:
cafile /etc/letsencrypt/live/<my-domain>/fullchain.pem
certfile /etc/letsencrypt/live/<my-domain>/fullchain.pem
keyfile /etc/letsencrypt/live/<my-domain>/privkey.pem
证书是使用 let's encrypt 生成的——来自 MQTT-Dash(Adnroid 应用程序)的连接完美运行。
我不知道 WiFiClientSecure 使用的是哪个 TLS 版本或如何定义它。
【问题讨论】:
-
添加 mosquitto.conf 的其余部分(可能是 /etc/mosquitto/conf.d 中的第二个文件),因为您在其中包含的任何内容都没有 TLS 配置
-
所以你似乎没有限制蚊子端(tls_version),它应该在默认模式下支持 1.0、1.1 和 1.2。我很想锻炼如何使 openssl 以详细模式运行或运行 wireshark 以查看实际发送的内容
标签: arduino mqtt esp8266 mosquitto