【问题标题】:ESP8266 with mosquitto fails TLS handshake带有 mosquitto 的 ESP8266 未能通过 TLS 握手
【发布时间】: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


【解决方案1】:

看看今天被问到的question,看来您可能必须指定tls_version才能让事情正常工作

listener 8883
certfile /etc/letsencrypt/live/home.kamidesigns.be/cert.pem
cafile /etc/letsencrypt/live/home.kamidesigns.be/chain.pem
keyfile /etc/letsencrypt/live/home.kamidesigns.be/privkey.pem
tls_version tlsv1.2

【讨论】:

  • 我试过了,但是没有用。我收到了同样的信息
猜你喜欢
  • 2021-01-02
  • 2021-08-26
  • 1970-01-01
  • 2012-04-15
  • 2018-10-21
  • 2019-02-28
  • 2012-06-11
  • 2016-03-21
  • 1970-01-01
相关资源
最近更新 更多