The_rain_of_May 2022-03-24 10:26 采纳率: 77.8%
浏览 120
已结题

MQTT修改服务质量等级后,无法连接服务器

根据客户需求需要将MQTT服务质量等级从QOS 0修改为QOS2;
我的修改:
connect时,1:将cleansession 修改为failse
publish 将QOS由0改为2
subscribe 将QOS由0改为2

现在发现修改后连接不上服务器,初步判定是SSL的问题。
SSL/TLS 的message length原来是229,修改了服务质量等级后是246
由于是第一次接触物联网,对SSL/TLS不是很了解,请问,我修改了MQTT服务质量等级后,也需要对SSL/TLS的相关配置进行修改吗?

由于是接收别人的代码,以下是连接正常时的打印信息
handshake
mbedtls-development/library/ssl_cli.c:3363: client state: 0
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:3363: client state: 1
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:0719: => write client hello
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 418, out_left: 418
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 418
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_cli.c:1051: <= write client hello
mbedtls-development/library/ssl_cli.c:3363: client state: 2
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:1447: => parse server hello
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 1406
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 1406
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 1401
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_cli.c:1733: server hello, total extension length: 9
mbedtls-development/library/ssl_cli.c:1922: <= parse server hello
mbedtls-development/library/ssl_cli.c:3363: client state: 3
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:4320: => parse certificate
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:4587: x509_verify_cert() returned -9984 (-0x2700)
mbedtls-development/library/ssl_tls.c:4684: <= parse certificate
mbedtls-development/library/ssl_cli.c:3363: client state: 4
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:2263: => parse server key exchange
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_cli.c:1982: ECDH curve: secp521r1
mbedtls-development/library/ssl_cli.c:2205: Server used SignatureAlgorithm 1
mbedtls-development/library/ssl_cli.c:2206: Server used HashAlgorithm 6
mbedtls-development/library/ssl_cli.c:2607: <= parse server key exchange
mbedtls-development/library/ssl_cli.c:3363: client state: 5
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:2640: => parse certificate request
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_cli.c:2757: <= parse certificate request
mbedtls-development/library/ssl_cli.c:3363: client state: 6
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:2767: => parse server hello done
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:3750: <= reuse previously read message
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_cli.c:2797: <= parse server hello done
mbedtls-development/library/ssl_cli.c:3363: client state: 7
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:4203: => write certificate
mbedtls-development/library/ssl_tls.c:4220: <= skip write certificate
mbedtls-development/library/ssl_cli.c:3363: client state: 8
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:2809: => write client key exchange
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 143, out_left: 143
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 143
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_cli.c:3051: <= write client key exchange
mbedtls-development/library/ssl_cli.c:3363: client state: 9
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:3102: => write certificate verify
mbedtls-development/library/ssl_tls.c:0501: => derive keys
mbedtls-development/library/ssl_tls.c:1067: => calc verify sha384
mbedtls-development/library/ssl_tls.c:1073: <= calc verify
mbedtls-development/library/ssl_tls.c:0957: <= derive keys
mbedtls-development/library/ssl_cli.c:3123: <= skip write certificate verify
mbedtls-development/library/ssl_cli.c:3363: client state: 10
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:4700: => write change cipher spec
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 6, out_left: 6
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 6
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:4714: <= write change cipher spec
mbedtls-development/library/ssl_cli.c:3363: client state: 11
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:5233: => write finished
mbedtls-development/library/ssl_tls.c:5107: => calc finished tls sha384
mbedtls-development/library/ssl_tls.c:5137: <= calc finished
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 45, out_left: 45
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 45
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:5342: <= write finished
mbedtls-development/library/ssl_cli.c:3363: client state: 12
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:4723: => parse change cipher spec
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 6
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 6
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 1
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:4801: <= parse change cipher spec
mbedtls-development/library/ssl_cli.c:3363: client state: 13
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:5359: => parse finished
mbedtls-development/library/ssl_tls.c:5107: => calc finished tls sha384
mbedtls-development/library/ssl_tls.c:5137: <= calc finished
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 45
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 45
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 40
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:1576: => decrypt buf
mbedtls-development/library/ssl_tls.c:2051: <= decrypt buf
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:5427: <= parse finished
mbedtls-development/library/ssl_cli.c:3363: client state: 14
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:3474: handshake: done
mbedtls-development/library/ssl_cli.c:3363: client state: 15
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:6567: <= handshake
ok
. Verifying peer X.509 certificate... failed
! The certificate Common Name (CN) does not match with the expected CN
! The certificate is not correctly signed by the trusted CA
! The certificate validity starts in the future

                .mqtttenter

mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 69, out_left: 69
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 69
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write

                .mqtt_connect

mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 66, out_left: 66
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 66
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 66, out_left: 66
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 66
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:6743: => read
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 33
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 33
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 28
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:1576: => decrypt buf
mbedtls-development/library/ssl_tls.c:2051: <= decrypt buf
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:7042: <= read
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 229, out_left: 229
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 229
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:6743: => read
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 34
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 34
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 29
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:1576: => decrypt buf
mbedtls-development/library/ssl_tls.c:2051: <= decrypt buf
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:7042: <= read
mbedtls-development/library/ssl_tls.c:6743: => read
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 34
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 34
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 29
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:1576: => decrypt buf
mbedtls-development/library/ssl_tls.c:2051: <= decrypt buf
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:7042: <= read
mbedtls-development/library/ssl_tls.c:6743: => read
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 229
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 229
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 224
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:1576: => decrypt buf
mbedtls-development/library/ssl_tls.c:2051: <= decrypt buf
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:7042: <= read

      get  0x7c   OK     lend = 165   

mbedtls-development/library/ssl_tls.c:6743: => read
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 71, out_left: 71
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 71
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 71
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 71
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 66
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:1576: => decrypt buf
mbedtls-development/library/ssl_tls.c:2051: <= decrypt buf
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:7042: <= read

      get  0x7c   OK     lend = 8   

以下是连接不上的打印信息
handshake
mbedtls-development/library/ssl_cli.c:3363: client state: 0
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:3363: client state: 1
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:0719: => write client hello
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 418, out_left: 418
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 418
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_cli.c:1051: <= write client hello
mbedtls-development/library/ssl_cli.c:3363: client state: 2
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:1447: => parse server hello
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 1406
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 1406
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 1401
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_cli.c:1733: server hello, total extension length: 9
mbedtls-development/library/ssl_cli.c:1922: <= parse server hello
mbedtls-development/library/ssl_cli.c:3363: client state: 3
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:4320: => parse certificate
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:4587: x509_verify_cert() returned -9984 (-0x2700)
mbedtls-development/library/ssl_tls.c:4684: <= parse certificate
mbedtls-development/library/ssl_cli.c:3363: client state: 4
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:2263: => parse server key exchange
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_cli.c:1982: ECDH curve: secp521r1
mbedtls-development/library/ssl_cli.c:2205: Server used SignatureAlgorithm 1
mbedtls-development/library/ssl_cli.c:2206: Server used HashAlgorithm 6
mbedtls-development/library/ssl_cli.c:2607: <= parse server key exchange
mbedtls-development/library/ssl_cli.c:3363: client state: 5
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:2640: => parse certificate request
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_cli.c:2757: <= parse certificate request
mbedtls-development/library/ssl_cli.c:3363: client state: 6
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:2767: => parse server hello done
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:3750: <= reuse previously read message
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_cli.c:2797: <= parse server hello done
mbedtls-development/library/ssl_cli.c:3363: client state: 7
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:4203: => write certificate
mbedtls-development/library/ssl_tls.c:4220: <= skip write certificate
mbedtls-development/library/ssl_cli.c:3363: client state: 8
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:2809: => write client key exchange
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 143, out_left: 143
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 143
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_cli.c:3051: <= write client key exchange
mbedtls-development/library/ssl_cli.c:3363: client state: 9
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:3102: => write certificate verify
mbedtls-development/library/ssl_tls.c:0501: => derive keys
mbedtls-development/library/ssl_tls.c:1067: => calc verify sha384
mbedtls-development/library/ssl_tls.c:1073: <= calc verify
mbedtls-development/library/ssl_tls.c:0957: <= derive keys
mbedtls-development/library/ssl_cli.c:3123: <= skip write certificate verify
mbedtls-development/library/ssl_cli.c:3363: client state: 10
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:4700: => write change cipher spec
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 6, out_left: 6
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 6
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:4714: <= write change cipher spec
mbedtls-development/library/ssl_cli.c:3363: client state: 11
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:5233: => write finished
mbedtls-development/library/ssl_tls.c:5107: => calc finished tls sha384
mbedtls-development/library/ssl_tls.c:5137: <= calc finished
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 45, out_left: 45
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 45
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:5342: <= write finished
mbedtls-development/library/ssl_cli.c:3363: client state: 12
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:4723: => parse change cipher spec
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 6
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 6
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 1
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:4801: <= parse change cipher spec
mbedtls-development/library/ssl_cli.c:3363: client state: 13
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:5359: => parse finished
mbedtls-development/library/ssl_tls.c:5107: => calc finished tls sha384
mbedtls-development/library/ssl_tls.c:5137: <= calc finished
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 45
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 45
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 40
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:1576: => decrypt buf
mbedtls-development/library/ssl_tls.c:2051: <= decrypt buf
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:5427: <= parse finished
mbedtls-development/library/ssl_cli.c:3363: client state: 14
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_cli.c:3474: handshake: done
mbedtls-development/library/ssl_cli.c:3363: client state: 15
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2428: <= flush output
mbedtls-development/library/ssl_tls.c:6567: <= handshake
ok
. Verifying peer X.509 certificate... failed
! The certificate Common Name (CN) does not match with the expected CN
! The certificate is not correctly signed by the trusted CA
! The certificate validity starts in the future

                          .mqtttenter.

mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 69, out_left: 69
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 69
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write

                             .mqtt_connect.

mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 66, out_left: 66
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 66
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 66, out_left: 66
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 66
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:6743: => read
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2390: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 5
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 5, nb_want: 33
mbedtls-development/library/ssl_tls.c:2390: in_left: 5, nb_want: 33
mbedtls-development/library/ssl_tls.c:2391: ssl->f_recv(_timeout)() returned 28
mbedtls-development/library/ssl_tls.c:2403: <= fetch input
mbedtls-development/library/ssl_tls.c:1576: => decrypt buf
mbedtls-development/library/ssl_tls.c:2051: <= decrypt buf
mbedtls-development/library/ssl_tls.c:3754: <= read record
mbedtls-development/library/ssl_tls.c:7042: <= read
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 246, out_left: 246
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 246
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:6743: => read
mbedtls-development/library/ssl_tls.c:3721: => read record
mbedtls-development/library/ssl_tls.c:2208: => fetch input
mbedtls-development/library/ssl_tls.c:2366: in_left: 0, nb_want: 5
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 73, out_left: 73
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 73
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 73, out_left: 73
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 73
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 72, out_left: 72
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 72
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 73, out_left: 73
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 73
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 73, out_left: 73
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 73
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
mbedtls-development/library/ssl_tls.c:7143: => write
mbedtls-development/library/ssl_tls.c:2701: => write record
mbedtls-development/library/ssl_tls.c:1258: => encrypt buf
mbedtls-development/library/ssl_tls.c:1560: <= encrypt buf
mbedtls-development/library/ssl_tls.c:2416: => flush output
mbedtls-development/library/ssl_tls.c:2435: message length: 73, out_left: 73
mbedtls-development/library/ssl_tls.c:2441: ssl->f_send() returned 73
mbedtls-development/library/ssl_tls.c:2460: <= flush output
mbedtls-development/library/ssl_tls.c:2850: <= write record
mbedtls-development/library/ssl_tls.c:7171: <= write
. (重复message length: 73, out_left: 73这条信息,直到超时)

                .Disconnect  

                Disconnect  
  • 写回答

5条回答 默认 最新

  • churuxu 2022-03-24 15:40
    关注

    跟SSL/TLS应该没有关系,
    排查是不是服务端问题,找几个不同的服务端,用同样方法去连(如https://test.mosquitto.org/
    排查是不是客户端问题,找几个mqtt调试软件来连你现在的服务器(如pahomqtt)

    服务端问题换服务端,客户端问题换客户端
    如果你需要别人更好的帮你排查,应该把详细报错信息发出来,而不是只说“连不上”

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(4条)

报告相同问题?

问题事件

  • 系统已结题 4月8日
  • 已采纳回答 3月31日
  • 修改了问题 3月24日
  • 赞助了问题酬金20元 3月24日
  • 展开全部

悬赏问题

  • ¥15 关于#linux#的问题(输入输出错误):出现这个界面接着我重新装系统,又让修电脑的师傅帮我扫描硬盘(没有问题)用着用着又卡死(相关搜索:固态硬盘)
  • ¥15 cv::resize不同线程时间不同
  • ¥15 web课程,怎么做啊😭没好好听课 根本不知道怎么下手
  • ¥15 做一个关于单片机的比较难的代码,然后搞一个PPT进行解释
  • ¥15 python提取.csv文件中的链接会经常出现爬取失败
  • ¥15 数据结构中的数组地址问题
  • ¥15 maya的mel里,怎样先选择模型A,然后利用mel脚本自动选择有相同名字的模型B呢。
  • ¥15 Python题,根本不会啊
  • ¥15 会会信号与系统和python的来
  • ¥15 关于#python#的问题