Mbedtls_ssl_handshake() segfault after ~1000 iterations

Hi @omtayroom

Then I can’t tell what my entropy source is. I thought mbedtls_entropy_func() is what organizes entropy. How can I find out?

Well. Yes. This function pretty much organizes entropy, but it is not the entropy source. It gathers entropy from all the sources in your platform, and conditions them into a single entropy.
On your platform, you should check what is configured in regards of entropy source, and what functions are called within mbedtls_entropy_init().
In addition, you should check whether you have explicit calls to mbedtls_entropy_add_source().

How can that account for a segfault? I understand that entropy sources block when there is no entropy? So I would expect threads to wait on it when its exhausted.

This is dependent on your implementation.

is debugging thread safe?

The default implementation of debugging is writing to stdout. If you have your own implementation of debug callback, which uses global variables, I would suggest you add thread safety to it.