Hello,
I’m trying to connect to a local Mosquitto broker using 8883 port.
I have a problem during the ssl_parse_server_hello: it returns -78 (0x004E), which should be MBEDTLS_ERR_NET_SEND_FAILED.
What could it be related to?
I have this verbose:
client hello, max version: [3:3]
, at line 757 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, current time: 0
, at line 695 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
dumping ‘client hello, random bytes’ (32 bytes)
, at line 766 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
0000: 00 00 00 00 39 e7 1c 5d 88 ad 03 bb e2 18 81 65 …9…]…e
, at line 766 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
0010: ce 28 cb 7a a3 33 7c c0 77 bd 4c f5 82 37 72 af .(.z.3|.w.L…7r.
, at line 766 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, session id len.: 0
, at line 819 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
dumping ‘client hello, session id’ (0 bytes)
, at line 820 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, add ciphersuite: c02c
, at line 887 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, add ciphersuite: c02b
, at line 887 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, got 3 ciphersuites
, at line 920 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, compress len.: 1
, at line 951 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, compress alg.: 0
, at line 953 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, adding signature_algorithms extension
, at line 178 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, adding supported_elliptic_curves extension
, at line 263 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, adding supported_point_formats extension
, at line 328 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
client hello, total extension length: 38
, at line 1025 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
=> write record
, at line 2701 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
output record: msgtype = 22, version = [3:1], msglen = 89
, at line 2838 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
dumping ‘output record sent to network’ (94 bytes)
, at line 2841 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
0000: 16 03 01 00 59 01 00 00 55 03 03 00 00 00 00 39 …Y…U…9
, at line 2841 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
0010: e7 1c 5d 88 ad 03 bb e2 18 81 65 ce 28 cb 7a a3 …]…e.(.z.
, at line 2841 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
0020: 33 7c c0 77 bd 4c f5 82 37 72 af 00 00 06 c0 2c 3|.w.L…7r…,
, at line 2841 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
0030: c0 2b 00 ff 01 00 00 26 00 0d 00 12 00 10 06 03 .+…&…
, at line 2841 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
0040: 06 01 05 03 05 01 04 03 04 01 03 03 03 01 00 0a …
, at line 2841 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
0050: 00 06 00 04 00 18 00 17 00 0b 00 02 01 00 …
, at line 2841 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
=> flush output
, at line 2416 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
message length: 94, out_left: 94
, at line 2435 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
ssl->f_send() returned -78 (-0x004e)
, at line 2441 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
mbedtls_ssl_flush_output() returned -78 (-0x004e)
, at line 2846 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
mbed
=> free
, at line 7344 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
<= free
, at line 7409 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_tls.c
tls_ssl_write_record() returned -78 (-0x004e)
, at line 1047 in file …\Middlewares\Third_Party\mbedTLS\library\ssl_cli.c
I also have seen that my Mosquitto broker see the connection, but the handshake is failing.
Could the problem be related to certificate? I attached the server certificate in the parsing: mbedtls_x509_crt_parse(&cacert, (const unsigned char *)mbedtls_m2mqtt_srv_crt, mbedtls_m2mqtt_srv_crt_len );
Edit 07/12 h 17.45: is it possible that the TLS handshaking fails because of a missing timedate?
Thank you,
Mattia