Mosquitto OpenSSL握手失败。
我有一个在CentOs 6.7中托管的Mosquitto 1.4.4代理。Mosquitto OpenSSL握手失败。
通过以下mosquitto文档 (http://mosquitto.org/man/mosquitto-tls-7.html)和 How do you set up encrypted mosquitto broker like a webpage which has https?
我试图启用客户端和mosquitto经纪人之间的加密连接,并得到了经纪人起来,并用TLS运行启用。
mosquitto version 1.4.4 (build date 2015-09-24 08:08:55+0000) starting
Config loaded from mosquitto.conf.
Opening ipv4 listen socket on port 8883.
Opening ipv6 listen socket on port 8883
分发根证书(ca.crt
)后,我试着运行测试轮在lib_mosquitto mosquitto_pub
,使用命令
mosquitto_pub -h x.x.x.x -p 8883 -t topic -m message --cafile ca.crt
我在mosquitto经纪人得到的是
New connection from y.y.y.y on port 8883.
OpenSSL Error: error:140780E5:SSL routines:SSL23_READ:ssl handshake failure
Socket error on client <unknown>, disconnecting.
有什么可以解决的?我哪里错了?
我在这里看到的失败最常见的原因是配置错误的证书。我建议使用openssl客户端进行调试。这应该让你更好地了解问题所在。
openssl s_client -connect x.x.x.x:8883 -CAfile ca.crt
你也可以尝试检查不同的服务器,以确保客户端工作正常。
wget http://test.mosquitto.org/ssl/mosquitto.org.crt
mosquitto_pub -h test.mosquitto.org -p 8883 -t topic -m message --cafile mosquitto.org.crt
应使用'-tls1 -servername
@ralight openssl客户端正常工作。问题应该与libmosquitto客户端。去尝试一些其他客户。 –
@jww我同意这不是一个编程问题(我只是自动回答而没有考虑问题的位置),但在这种情况下,您的其他评论是不必要的 - 服务器只支持TLS,而不支持SSL并且不支持SNI。 – ralight
Stack Overflow是一个编程和开发问题的网站。这个问题似乎与题目无关,因为它不涉及编程或开发。请参阅帮助中心的[我可以询问哪些主题](http://*.com/help/on-topic)。也许[超级用户](http://superuser.com/)或[服务器故障](http://serverfault.com/)会是一个更好的地方。另请参阅[我在哪里发布有关Dev Ops的问题?](http://meta.stackexchange.com/q/134306)。 – jww
我并不确定是否libmosquitto openssl客户端出现故障。因为在serverfault上没有mosquitto或mqtt的标签,所以我实际上在这里发布了它。我的错。 我仍然认识到这是错误的论坛。谢谢。 –