Hello,
I am new to Mbed TLS and have been tasked with using it to replace our current TLS architecture. As a starting point, I am using ssl_client2 to try to communicate with our test server, but I am receiving an error. I have modified ssl_client2 to parse my root certificate, device certificate, and key file. I’m also forcing the only ciphersuite that our server uses. When attempting to connect to my local test server, I am receiving the following:
Last error was: -0x7280 - SSL - The connection indicated an EOF
Here is the output with debug_level=5:
. Seeding the random number generator… ok
. Loading the CA root certificate …MBEDTLS_CERTS_C not defined. ok (1 skipped)
. Loading the client cert. and key… ok (key type: EC)
. Connecting to tcp/10.0.2.15/8080… ok
. Setting up the SSL/TLS structure… ok
. Performing the SSL/TLS handshake…ssl_tls.c:8781: |2| => handshake
ssl_cli.c:3818: |2| client state: 0
ssl_tls.c:3070: |2| => flush output
ssl_tls.c:3082: |2| <= flush output
ssl_cli.c:3818: |2| client state: 1
ssl_tls.c:3070: |2| => flush output
ssl_tls.c:3082: |2| <= flush output
ssl_cli.c:0825: |2| => write client hello
ssl_cli.c:0863: |3| client hello, max version: [3:3]
ssl_cli.c:0745: |3| client hello, current time: 1556761122
ssl_cli.c:0872: |3| dumping ‘client hello, random bytes’ (32 bytes)
ssl_cli.c:0872: |3| 0000: 5c ca 4a 22 e7 7e 11 52 82 b8 0a d4 cc 4a 55 94 .J".~.R…JU.
ssl_cli.c:0872: |3| 0010: d6 11 84 3a 6d 64 f3 e8 ea f3 28 11 36 a1 6a be …:md…(.6.j.
ssl_cli.c:0925: |3| client hello, session id len.: 0
ssl_cli.c:0926: |3| dumping ‘client hello, session id’ (0 bytes)
ssl_cli.c:0973: |3| client hello, add ciphersuite: c0ae
ssl_cli.c:0985: |3| client hello, got 1 ciphersuites (excluding SCSVs)
ssl_cli.c:0994: |3| adding EMPTY_RENEGOTIATION_INFO_SCSV
ssl_cli.c:1043: |3| client hello, compress len.: 1
ssl_cli.c:1045: |3| client hello, compress alg.: 0
ssl_cli.c:0111: |3| client hello, adding server name extension: sepServer
ssl_cli.c:0228: |3| client hello, adding signature_algorithms extension
ssl_cli.c:0313: |3| client hello, adding supported_elliptic_curves extension
ssl_cli.c:0378: |3| client hello, adding supported_point_formats extension
ssl_cli.c:0627: |3| client hello, adding session ticket extension
ssl_cli.c:1122: |3| client hello, total extension length: 82
ssl_tls.c:3499: |2| => write handshake message
ssl_tls.c:3658: |2| => write record
ssl_tls.c:3738: |3| output record: msgtype = 22, version = [3:3], msglen = 131
ssl_tls.c:3741: |4| dumping ‘output record sent to network’ (136 bytes)
ssl_tls.c:3741: |4| 0000: 16 03 03 00 83 01 00 00 7f 03 03 5c ca 4a 22 e7 ….J".
ssl_tls.c:3741: |4| 0010: 7e 11 52 82 b8 0a d4 cc 4a 55 94 d6 11 84 3a 6d ~.R…JU…:m
ssl_tls.c:3741: |4| 0020: 64 f3 e8 ea f3 28 11 36 a1 6a be 00 00 04 c0 ae d…(.6.j…
ssl_tls.c:3741: |4| 0030: 00 ff 01 00 00 52 00 00 00 0e 00 0c 00 00 09 73 …R…s
ssl_tls.c:3741: |4| 0040: 65 70 53 65 72 76 65 72 00 0d 00 16 00 14 06 03 epServer…
ssl_tls.c:3741: |4| 0050: 06 01 05 03 05 01 04 03 04 01 03 03 03 01 02 03 …
ssl_tls.c:3741: |4| 0060: 02 01 00 0a 00 18 00 16 00 19 00 1c 00 18 00 1b …
ssl_tls.c:3741: |4| 0070: 00 17 00 16 00 1a 00 15 00 14 00 13 00 12 00 0b …
ssl_tls.c:3741: |4| 0080: 00 02 01 00 00 23 00 00 …#…
ssl_tls.c:3070: |2| => flush output
ssl_tls.c:3089: |2| message length: 136, out_left: 136
ssl_tls.c:3094: |2| ssl->f_send() returned 136 (-0xffffff78)
ssl_tls.c:3122: |2| <= flush output
ssl_tls.c:3791: |2| <= write record
ssl_tls.c:3635: |2| <= write handshake message
ssl_cli.c:1157: |2| <= write client hello
ssl_cli.c:3818: |2| client state: 2
ssl_tls.c:3070: |2| => flush output
ssl_tls.c:3082: |2| <= flush output
ssl_cli.c:1550: |2| => parse server hello
ssl_tls.c:4626: |2| => read record
ssl_tls.c:2841: |2| => fetch input
ssl_tls.c:3002: |2| in_left: 0, nb_want: 5
ssl_tls.c:3034: |2| in_left: 0, nb_want: 5
ssl_tls.c:3035: |2| ssl->f_recv(_timeout)() returned 0 (-0x0000)
ssl_tls.c:5288: |1| mbedtls_ssl_fetch_input() returned -29312 (-0x7280)
ssl_tls.c:4659: |1| ssl_get_next_record() returned -29312 (-0x7280)
ssl_cli.c:1557: |1| mbedtls_ssl_read_record() returned -29312 (-0x7280)
ssl_tls.c:8791: |2| <= handshake
failed
! mbedtls_ssl_handshake returned -0x7280
Last error was: -0x7280 - SSL - The connection indicated an EOF
ssl_tls.c:9650: |2| => free
ssl_tls.c:9715: |2| <= free
Not sure if this makes a difference, but the original device certificate was in a .p7b file, which I believe is not supported. Hence, I extracted the certificate and have it in PEM format. I’m also working in a Ubuntu 16.04 VM.
I’ve only been working with TLS in general for a couple weeks, so I apologize in advance if I haven’t included enough information or - better yet - there is a simple configuration I’m missing.
Thanks!