Using the fast simple build system with mbedtls

Mbedtls is a very impressive implementation of SSL/TLS that comes from ARM. You can read about it here:

GitHub - Mbed-TLS/mbedtls: An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API. Releases are on a varying cadence, typically around 3 - 6 months between releases.

I am super impressed with the quality and simplicity of their SSL/TLS implementation.

Openssl by comparison is nightmarishly complicated.

What I really loved about this library was it only took an hour or so to port it over to use my simple makefile system.

On my Mac I can do make clean and make -j (parallel build) and under 1.6 seconds to recompile the entire library and example.

This is the 4 line makefile I wrote for it:

DIRS=\ mbedtls\ include ../make/makefile.core

This is the server code:

core/mbedtls_server at main ยท eliotmuirgrid/core

If you are curious to try out mbedtls then make sure you have the right sandbox tools installed then you can just do:

git clone https://github.com/eliotmuirgrid/core.git cd core/mbedtls_server/ make

That builds the server. You can run the server as ./test.

Then for the client:

cd ../mbedtls_client/ make

I think this technique of building mbedtls compares quite favourably with the makefiles that came with the library which are more conventional in their approach: