在SSL上运行的MOSQUITO客户端和代理

在SSL上运行的MOSQUITO客户端和代理,ssl,mqtt,mosquitto,Ssl,Mqtt,Mosquitto,我已经使用SSL和Let's Encrypt certs设置了一个代理 我已尝试测试连接到wss://broker:9002/mqtt,它正在工作。我还尝试使用mqtt.js命令行界面订阅代理mqtts://broker:8883/mqtt成功 但是,我无法让mosquitto_sub和mosquitto_pub工作。 我试过了 $ mosquitto_sub -h www.my-host.com.ar -p 8883 -t hello -d --cafile fullchain.pem Cli

我已经使用SSL和Let's Encrypt certs设置了一个代理

我已尝试测试连接到
wss://broker:9002/mqtt
,它正在工作。我还尝试使用
mqtt.js
命令行界面订阅代理
mqtts://broker:8883/mqtt
成功

但是,我无法让
mosquitto_sub
mosquitto_pub
工作。 我试过了

$ mosquitto_sub -h www.my-host.com.ar -p 8883 -t hello -d --cafile fullchain.pem
Client mosqsub/21069-atlantis sending CONNECT
Error: A TLS error occurred.
其中fullchain.pem与服务器上的ca证书相同

mosquitto.log的经纪人说

1456709201: OpenSSL Error: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca
1456709201: OpenSSL Error: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure
1456709201: Socket error on client <unknown>, disconnecting.
1456709206: New connection from <my-ip> on port 8883.
尝试在mosquitto_sub和mosquitto_pub命令的末尾添加“-unsecure”。这允许客户端绕过将证书主机名与远程主机名匹配的检查。我不得不用我生成的一些自签名证书来实现这一点

以下是这些命令的“-help”中的相关注释:

--insecure : do not check that the server certificate hostname matches the remote
             hostname. Using this option means that you cannot be sure that the
             remote host is the server you wish to connect to and so is insecure.
             Do not use this option in a production environment.
尝试在mosquitto_sub和mosquitto_pub命令的末尾添加“-unsecure”。这允许客户端绕过将证书主机名与远程主机名匹配的检查。我不得不用我生成的一些自签名证书来实现这一点

以下是这些命令的“-help”中的相关注释:

--insecure : do not check that the server certificate hostname matches the remote
             hostname. Using this option means that you cannot be sure that the
             remote host is the server you wish to connect to and so is insecure.
             Do not use this option in a production environment.

mosquitto_sub-h-p8883-t测试——不安全-d
一直在尝试发送连接,而在代理日志上显示
例程:SSL23_GET_CLIENT\u HELLO:unknown protocol
另外,我代理正在使用让我们加密应该有效的证书
mosquitto_sub-h-p8883-t测试——不安全-d
一直在尝试发送连接,当代理日志上显示
例程:SSL23\u GET\u CLIENT\u HELLO:unknown protocol
时,代理正在使用应该有效的让我们加密证书