带蚊子的 ESP8266 无法通过 TLS 握手
ESP8266 with mosquitto fails TLS handshake
我想建立从 ESP8266 到 mosquitto MQTT 服务器的 TLS 连接。
我将 Adafruit example INO 与 WiFiClientSecure 一起使用,它成功连接到我的 Wifi,与其他 MQTT 服务器(例如 iot.eclipse.org:8883)一起工作正常
就在我尝试连接到我自己的 mosquitto 实例时,它失败了
在 mosquitto 日志中显示:
OpenSSL Error: error:1408A10B:SSL routines:SSL3_GET_CLIENT_HELLO:wrong version number
我的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 版本或如何定义它。
看看这个 今天问的问题,看来你可能必须指定一个 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
我想建立从 ESP8266 到 mosquitto MQTT 服务器的 TLS 连接。
我将 Adafruit example INO 与 WiFiClientSecure 一起使用,它成功连接到我的 Wifi,与其他 MQTT 服务器(例如 iot.eclipse.org:8883)一起工作正常
就在我尝试连接到我自己的 mosquitto 实例时,它失败了 在 mosquitto 日志中显示:
OpenSSL Error: error:1408A10B:SSL routines:SSL3_GET_CLIENT_HELLO:wrong version number
我的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 版本或如何定义它。
看看这个 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