使用密钥无法连接通讯

在window,和Docker上部署成功后,无法使用自己创建的的SSL密钥,无法通讯

麻烦提供一下更详细的重现步骤或错误日志。

Error: Client network socket disconnected before secure TLS connection was e!!!!请问是我的SSL创建的有问题吗?

看起来非常像。
你可以把重现的步骤详细说描述一下

  1. emqx 服务的日志发一下。
  2. 创建密钥的脚本也发一下。

在网上找的教程运行的,MQTT系列:(三)EMQ X配置SSL/TLS,并使用MQTT X进行链接_mqttx上是怎么实现mqtts的自签认证链接的-CSDN博客
日志在哪里查看?我是找的以前的安装包,在window11下运行的EMQX,并且下载了MQTTX,

那麻烦提供一下创建的脚本和重步骤,还是emqx 的日志
emqx 的日志你百度一下应该能找到怎么看的。

[2024-10-22 13:55:05] [INFO] MQTTX Desktop App init
[2024-10-22 13:55:17] [INFO] Connection EMTX Srever was edited, ID: 0e2e8c47-b43c-46ec-bd60-ce4e6ebf3f95
[2024-10-22 13:55:18] [INFO] Assigned ID 0e2e8c47-b43c-46ec-bd60-ce4e6ebf3f95 to MQTTX client
[2024-10-22 13:55:18] [INFO] Client EMTX Srever connected using MQTT/SSL connection at mqtts://localhost:18083:1883
[2024-10-22 13:55:18] [ERROR] Connection for EMTX Srever failed, MQTT.js onError trigger, Error: Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:607:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1544:19)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
[2024-10-22 13:55:18] [WARN] MQTTX force closed the connection EMTX Srever (Client ID: mqttx_8e79ec1d)
[2024-10-22 13:55:18] [ERROR] Connection for EMTX Srever failed, MQTT.js onError trigger, Error: Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:607:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1544:19)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
[2024-10-22 13:55:18] [WARN] MQTTX force closed the connection EMTX Srever (Client ID: mqttx_8e79ec1d)
[2024-10-22 13:55:18] [INFO] Connection for EMTX Srever closed, MQTT.js onClose trigger
您看一下是这个吗?

看起来你用的是 MQTTX 桌面客户端,应该是这里的 ip port 设置不对
EMQX 的 MQTTS 默认端口为 8883
但你这里写了 http 端口的 18083 和 MQTT-tcp 的 1883 端口

请问应该怎么修改?

[2024-10-22 15:38:44] [INFO] MQTTX Desktop App init

[2024-10-22 15:39:05] [INFO] Connection EMTX Srever was edited, ID: 0e2e8c47-b43c-46ec-bd60-ce4e6ebf3f95

[2024-10-22 15:39:06] [INFO] Assigned ID 0e2e8c47-b43c-46ec-bd60-ce4e6ebf3f95 to MQTTX client

[2024-10-22 15:39:06] [INFO] Client EMTX Srever connected using MQTT/SSL connection at mqtts://localhost:8883:8083

[2024-10-22 15:39:06] [ERROR] Connection for EMTX Srever failed, MQTT.js onError trigger, Error: Error: write EPROTO 2284872:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:…/…/third_party/boringssl/src/ssl/tls_record.cc:242:

at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)

[2024-10-22 15:39:06] [WARN] MQTTX force closed the connection EMTX Srever (Client ID: mqttx_8e79ec1d)

[2024-10-22 15:39:06] [INFO] Connection for EMTX Srever closed, MQTT.js onClose trigger

Error: write EPROTO 2284872:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:…/…/third_party/boringssl/src/ssl/tls_record.cc:242:

这。。。

启用 TLS 配置:

证书生成脚本: