7 years, 9 months ago.

How the communication between client-server application can be done using the mbedTLS library?

I want to use mBedTLS library to develop a dtls client-server application for a secure packet communication between of NUCLEO Boards. I am using Online compiler and I am importing mBedTLS library available at github. Further, I am using the dtls_client.c and dtls_server.c files available in programs/ssl folder of the mBedTLS library. According to my understanding after successfully running the client.c or server.c application codes, online compiler will be generating binary files which I would be able to port on two NUCLEO boards to enable basic functionality of secure packet exchange between them.

However when I compile the dtls_server.c or dtls_client.c code I get the following errors:

- #error "Platform entropy sources only work on Unix and Windows, see MBEDTLS_NO_PLATFORM_ENTROPY in config.h". - #error "This module only works on Unix and Windows, see MBEDTLS_NET_C in config.h"

When I disable the above error directives, I get the following error:

- Cannot open source input file "sys/types.h": No such file or directory "#include <sys/types.h>"

I have tried to change the board to FRDM_K64F and some other dtls library versions available from mbed.org in import wizard but couldn't solve those errors. So I wonder If I am going into the right direction to use online compiler to accomplish the above mentioned task or do I need to switch to Linux and use yotta build tools. Any help or comments in this context will be appreciated.

1 Answer

5 years, 10 months ago.

HI, I apologize for very delayed reply. The dtls_client and dtls_server are sample application designed and tested for PC.

You can take the, as reference, and adjust them to Mbed OS. You will need to create an Mbed OS project, and take the `dtls_client.c` and `dtls_server.c` relevant code to your application. You can look at the tls-client reference application for Mbed OS, which is based on the ssl_client application.