"Unable to connect (8)" Mosquitto 错误

"Unable to connect (8)" error with Mosquitto

我有两台安装非常相似的服务器。一个在 Debian 8.7 上,另一个在 Debian 8.8 上。

在第一台服务器上,当我尝试通过 SSL 订阅 MQTT 主题时:

mosquitto_sub -h localhost -t test -p 8883 --cafile /etc/mosquitto/certs/selfsigned.pem -d

我收到一条似乎来自 OpenSSL 的明确消息(我已经知道错误的原因,这不是我的问题的目标):

Client mosqsub/9647-CIEYY2T7 sending CONNECT
OpenSSL Error: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Error: Protocol error

在另一台服务器上,对于完全相同的命令,我只收到这条模糊的消息,没有 OpenSSL 解释:

Unable to connect (8).

我有两个问题:

请在此处查看答案(有人告诉我去 post 关于 SO 的问题): https://security.stackexchange.com/questions/159177/how-to-make-openssl-errors-more-verbose-for-mqtt-client

纳粹试图关闭这个有用的规则 question/answer :

if your question generally covers (...) software tools commonly used by programmers (...) then you’re in the right place to ask your question!

来源:https://whosebug.com/help/on-topic

是的,mosquitto_sub 和 mosquitto_pub 是程序员常用的工具,因为如果您尝试直接使用 java 代码和充气城堡设置 SSL MQTT 连接而不进行测试用更简单的工具交换,你可能做错了。