2017-10-13 106 views
0

我想建立从ESP8266到mosquitto MQTT服务器的TLS连接。带蚊子的ESP8266失败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 

的证书使用让我们从MQTT - 达什(Adnroid内APP)encrypt-连接产生完美的作品。

我想不通哪个TLS版本的WiFiClientSecure使用或如何定义它。

+1

添加mosquitto.conf的其余部分(在/ etc可能是第二个文件/ mosquitto /conf.d),因为在那里包含的任何东西都没有TLS配置 – hardillb

+0

所以你似乎没有限制蚊子方面(tls_version),它应该在默认模式下支持1.0,1.1和1.2。我会试着研究如何让openssl在详细模式下运行或者运行wireshark来查看线路上实际发送的内容。 – hardillb

回答

0

望着这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 
+0

我试过了,但没有帮助。我收到了相同的消息 – Stefan

+0

最后它确实将tls_version设置为tlsv1 – Stefan