gpt4 book ai didi

ssl - mosquitto openssl 错误 : ssl3_get_record:wrong version number

转载 作者:行者123 更新时间:2023-12-04 22:39:53 25 4
gpt4 key购买 nike

当我使用 mosquitto 与路由器上的客户端程序建立 TLS 连接时,它不起作用。
这是错误日志:

[21028.515924]~DLT~14068~INFO     ~FIFO /tmp/dlt cannot be opened. Retrying later...
1635324116: mosquitto version 1.6.9 starting
1635324116: Config loaded from /etc/mosquitto/mosquitto.conf.
1635324116: Opening ipv4 listen socket on port 8883.
1635324116: Opening ipv6 listen socket on port 8883.
1635324132: New connection from 192.168.8.1 on port 8883.
1635324132: OpenSSL Error[0]: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
1635324132: Socket error on client <unknown>, disconnecting.
这是我的 mosquitto.conf:
port 8883

cafile /mnt/d/Files/Desktop/Project/cert/ca/ca.crt

certfile /mnt/d/Files/Desktop/Project/cert/broker/broker.crt

keyfile /mnt/d/Files/Desktop/Project/cert/broker/broker.key

require_certificate true

tls_version tlsv1.2

这是我的客户端 SSL 代码:
ssl_opts.trustStore = "/mnt/d/Files/Desktop/Project/cert/ca/ca.crt";
ssl_opts.keyStore = "/mnt/d/Files/Desktop/Project/cert/client/client.crt";
ssl_opts.privateKey = "/mnt/d/Files/Desktop/Project/cert/client/client.key";
ssl_opts.enableServerCertAuth = 1;
ssl_opts.verify = 1;
ssl_opts.sslVersion = MQTT_SSL_VERSION_TLS_1_2;
这是我的客户的更具体的代码:
publisher.h
publisher.c
agent.c

最佳答案

来自 docs :

An optional array of null-terminated strings specifying the servers towhich the client will connect. Each string takes the formprotocol://host:port. protocol must be tcp or ssl. For host, you canspecify either an IP address or a host name. For instance, to connectto a server running on the local machines with the default MQTT port,specify tcp://localhost:1883. If this list is empty (the default), theserver URI specified on MQTTClient_create() is used.


确保您的 URL 以 ssl:// 开头不仅仅是IP地址和端口。

关于ssl - mosquitto openssl 错误 : ssl3_get_record:wrong version number,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69735578/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com