物联网无法使用MQTT + TLS连接到服务器
我使用MQTT + tls将IoT设备连接到具有SIM900支持的GPRS的服务器.
I use MQTT+tls to connect the IoT device to the server with GPRS supported by SIM900.
IoT设备连接到服务器,而HTTP或HTTP上没有任何问题.
The IoT device connects to the server without any problem on HTTP or HTTPs.
但是,当我在服务器上使用Tomcat设置ssl代理时,IoT设备可以成功获取发送成功"的状态,但始终会出现等待发送确认超时"错误.
However, When I set up the ssl proxy on the server with Tomcat,the IoT device can get status of "send ok" successfully,but always gets "wait send ok ack timeout" error.
服务器上安装的Wireshk无法捕获任何有用的信息.
The wireshark installed on the server can't capture any useful infomation.
在SIM900上,您不能使用TCP + SSL.这就是为什么您可以使用HTTPS做到这一点,但不能使用MQTT + SSL做到这一点的原因.您可以在不使用SSL的情况下使用MQTT协议.
on SIM900 you can't use TCP+SSL. That's why you can do it with HTTPS but you can't do it with MQTT+SSL. You could use the MQTT protocol without SSL.
要使SIM900上的MQTT + SSL正常运行,我所做的就是使用wolfSSL加密数据,然后通过没有SSL的TCP连接发送数据.
What I did to get this working (MQTT+SSL) on SIM900 was encrypting the data using wolfSSL and then send it through a TCP, without SSL, connection.