Hi While working with integrating cloud on embedded platform i’ m using Mbed TLS ,
While performing handshake its able to exchange hello, but when it tries to do SERVER_CHANGE_CIPHER_SPEC it block on ssl->f_recv function and does nothing.
These are my logs i have added function lines in log for batter clarity.
fun mbedtls_ssl_handshake, line 6481
=> handshake
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 0 //MBEDTLS_SSL_HELLO_REQUEST:
client state: 0
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 1 //MBEDTLS_SSL_CLIENT_HELLO,
client state: 1
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> write client hello
client hello, max version: [3:3]
client hello, current time: 1530597388
client hello, session id len.: 0
=> write record
output record: msgtype = 22, version = [3:3], msglen = 287
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2506
message length: 292, out_left: 292
fun mbedtls_ssl_flush_output, line 2520
fun mbedtls_ssl_flush_output, line 2523
fun mbedtls_ssl_flush_output, line 2529
<= flush output
fun mbedtls_ssl_flush_output, line 2539
<= write record
<= write client hello
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 2 //MBEDTLS_SSL_SERVER_HELLO,
client state: 2
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
fun mbedtls_ssl_handshake_client_step, line 3375
fun ssl_parse_server_hello, line 1393
=> parse server hello
fun mbedtls_ssl_read_record, line 3804
=> read record
fun mbedtls_ssl_read_record, line 3810
fun mbedtls_ssl_read_record_layer, line 3844
fun mbedtls_ssl_read_record_layer, line 3865
fun mbedtls_ssl_read_record_layer, line 3875
fun mbedtls_ssl_fetch_input, line 2229
=> fetch input
fun mbedtls_ssl_fetch_input, line 2418
in_left: 0, nb_want: 5
fun mbedtls_ssl_fetch_input, line 2422
fun mbedtls_ssl_fetch_input, line 2425
fun mbedtls_ssl_fetch_input, line 2432
fun mbedtls_ssl_fetch_input, line 2446
in_left: 0, nb_want: 5
in_left 0, nb_want 5
fun mbedtls_ssl_fetch_input, line 2471
<= fetch input
fun mbedtls_ssl_read_record_layer, line 3883
input record: msgtype = 22, version = [3:3], msglen = 3710
fun mbedtls_ssl_fetch_input, line 2229
=> fetch input
fun mbedtls_ssl_fetch_input, line 2418
in_left: 5, nb_want: 3715
fun mbedtls_ssl_fetch_input, line 2422
fun mbedtls_ssl_fetch_input, line 2425
fun mbedtls_ssl_fetch_input, line 2432
fun mbedtls_ssl_fetch_input, line 2446
in_left: 5, nb_want: 3715
in_left 5, nb_want 3715
fun mbedtls_ssl_fetch_input, line 2471
<= fetch input
fun mbedtls_ssl_read_record_layer, line 3939
fun mbedtls_ssl_read_record_layer, line 4047
handshake message: msglen = 3710, type = 2, hslen = 81
fun mbedtls_ssl_read_record, line 3832
<= read record
fun mbedtls_ssl_read_record, line 3838
fun ssl_parse_server_hello, line 1473
server hello, current time: 1530597390
fun ssl_parse_server_hello, line 1540
fun ssl_parse_server_hello, line 1596
server hello, session id len.: 32
fun ssl_parse_server_hello, line 1621
fun ssl_parse_server_hello, line 1644
no session has been resumed
server hello, chosen ciphersuite: c027
server hello, compress alg.: 0
fun ssl_parse_server_hello, line 1651
fun ssl_parse_server_hello, line 1653
server hello, chosen ciphersuite: TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256
fun ssl_parse_server_hello, line 1668
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
fun ssl_parse_server_hello, line 1672
server hello, total extension length: 5
fun ssl_parse_server_hello, line 1705
found renegotiation extension
fun ssl_parse_server_hello, line 1842
<= parse server hello
fun ssl_parse_server_hello, line 1902
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 3 //MBEDTLS_SSL_SERVER_CERTIFICATE
client state: 3
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> parse certificate
fun mbedtls_ssl_read_record, line 3804
=> read record
fun mbedtls_ssl_read_record, line 3810
fun mbedtls_ssl_read_record_layer, line 3844
fun mbedtls_ssl_read_record_layer, line 3849
fun mbedtls_ssl_read_record_layer, line 3858
handshake message: msglen = 3629, type = 11, hslen = 3264
fun mbedtls_ssl_read_record, line 3832
<= read record
fun mbedtls_ssl_read_record, line 3838
<= parse certificate
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 4 //MBEDTLS_SSL_SERVER_KEY_EXCHANGE
client state: 4
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> parse server key exchange
fun mbedtls_ssl_read_record, line 3804
=> read record
fun mbedtls_ssl_read_record, line 3810
fun mbedtls_ssl_read_record_layer, line 3844
fun mbedtls_ssl_read_record_layer, line 3849
fun mbedtls_ssl_read_record_layer, line 3858
handshake message: msglen = 365, type = 12, hslen = 333
fun mbedtls_ssl_read_record, line 3832
<= read record
fun mbedtls_ssl_read_record, line 3838
ECDH curve: secp256r1
Server used SignatureAlgorithm 1
Server used HashAlgorithm 2
<= parse server key exchange
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 5 //MBEDTLS_SSL_CERTIFICATE_REQUEST
client state: 5
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> parse certificate request
fun mbedtls_ssl_read_record, line 3804
=> read record
fun mbedtls_ssl_read_record, line 3810
fun mbedtls_ssl_read_record_layer, line 3844
fun mbedtls_ssl_read_record_layer, line 3849
fun mbedtls_ssl_read_record_layer, line 3858
handshake message: msglen = 32, type = 13, hslen = 28
fun mbedtls_ssl_read_record, line 3832
<= read record
fun mbedtls_ssl_read_record, line 3838
got a certificate request
Supported Signature Algorithm found: 6,1
Supported Signature Algorithm found: 6,3
Supported Signature Algorithm found: 4,1
Supported Signature Algorithm found: 5,1
Supported Signature Algorithm found: 2,1
Supported Signature Algorithm found: 4,3
Supported Signature Algorithm found: 5,3
Supported Signature Algorithm found: 2,3
<= parse certificate request
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 6 //MBEDTLS_SSL_SERVER_HELLO_DONE
client state: 6
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> parse server hello done
fun mbedtls_ssl_read_record, line 3804
=> read record
fun mbedtls_ssl_read_record, line 3810
fun mbedtls_ssl_read_record_layer, line 3844
fun mbedtls_ssl_read_record_layer, line 3849
fun mbedtls_ssl_read_record_layer, line 3858
handshake message: msglen = 4, type = 14, hslen = 4
fun mbedtls_ssl_read_record, line 3832
<= read record
fun mbedtls_ssl_read_record, line 3838
<= parse server hello done
Hello server done !
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 7 //MBEDTLS_SSL_CLIENT_CERTIFICATE
client state: 7
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> write certificate
=> write record
output record: msgtype = 22, version = [3:3], msglen = 7
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2506
message length: 12, out_left: 12
fun mbedtls_ssl_flush_output, line 2520
fun mbedtls_ssl_flush_output, line 2523
fun mbedtls_ssl_flush_output, line 2529
<= flush output
fun mbedtls_ssl_flush_output, line 2539
<= write record
<= write certificate
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 8 //MBEDTLS_SSL_CLIENT_KEY_EXCHANGE
client state: 8
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> write client key exchange
=> write record
output record: msgtype = 22, version = [3:3], msglen = 70
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2506
message length: 75, out_left: 75
fun mbedtls_ssl_flush_output, line 2520
fun mbedtls_ssl_flush_output, line 2523
fun mbedtls_ssl_flush_output, line 2529
<= flush output
fun mbedtls_ssl_flush_output, line 2539
<= write record
<= write client key exchange
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 9 //MBEDTLS_SSL_CERTIFICATE_VERIFY
client state: 9
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> write certificate verify
=> derive keys
ciphersuite = TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256
keylen: 16, minlen: 64, ivlen: 16, maclen: 32
<= derive keys
<= skip write certificate verify
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 10 //MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC
client state: 10
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> write change cipher spec
=> write record
output record: msgtype = 20, version = [3:3], msglen = 1
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2506
message length: 6, out_left: 6
fun mbedtls_ssl_flush_output, line 2520
fun mbedtls_ssl_flush_output, line 2523
fun mbedtls_ssl_flush_output, line 2529
<= flush output
fun mbedtls_ssl_flush_output, line 2539
<= write record
<= write change cipher spec
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 11 //MBEDTLS_SSL_CLIENT_FINISHED
client state: 11
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> write finished
=> calc finished tls sha256
<= calc finished
switching to new transform spec for outbound data
=> write record
=> encrypt buf
before encrypt: msglen = 80, including 16 bytes of IV and 16 bytes of padding
<= encrypt buf
output record: msgtype = 22, version = [3:3], msglen = 80
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2506
message length: 85, out_left: 85
fun mbedtls_ssl_flush_output, line 2520
fun mbedtls_ssl_flush_output, line 2523
fun mbedtls_ssl_flush_output, line 2529
<= flush output
fun mbedtls_ssl_flush_output, line 2539
<= write record
<= write finished
fun mbedtls_ssl_handshake_client_step, line 3456
fun mbedtls_ssl_handshake_step, line 6472
fun mbedtls_ssl_handshake, line 6495
fun mbedtls_ssl_handshake, line 6492
fun mbedtls_ssl_handshake_step, line 6454
fun mbedtls_ssl_handshake_step, line 6463
fun mbedtls_ssl_handshake_client_step, line 3316
client state: 12 //MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC
client state: 12
fun mbedtls_ssl_flush_output, line 2482
=> flush output
fun mbedtls_ssl_flush_output, line 2499
<= flush output
fun mbedtls_ssl_handshake_client_step, line 3329
fun mbedtls_ssl_handshake_client_step, line 3353
=> parse change cipher spec
=> parse change cipher spec
fun mbedtls_ssl_parse_change_cipher_spec, line 4639
fun mbedtls_ssl_read_record, line 3804
=> read record
fun mbedtls_ssl_read_record, line 3810
fun mbedtls_ssl_read_record_layer, line 3844
fun mbedtls_ssl_read_record_layer, line 3865
fun mbedtls_ssl_read_record_layer, line 3875
fun mbedtls_ssl_fetch_input, line 2229
=> fetch input
fun mbedtls_ssl_fetch_input, line 2418
in_left: 0, nb_want: 5
fun mbedtls_ssl_fetch_input, line 2422
fun mbedtls_ssl_fetch_input, line 2425
fun mbedtls_ssl_fetch_input, line 2432
fun mbedtls_ssl_fetch_input, line 2446 //Blocks here and does nothing
Can i get help in here.
Response would be appreciated.
Thank you !