Hi,
In nRF Connect SDK v2.4.0, the nRF9160 https_client sample does not work when compiling with -DOVERLAY_CONFIG=overlay-tfm_mbedtls.conf. The socket connect will give the error -22 or -EINVAL. I have bisected the nRF Connect SDK git history between v2.3.0 and v2.4.0 and found the offending commit to be 6e303d8ccd4bae12a63f163dc339a5563cd9b3e1: https://github.com/nrfconnect/sdk-nrf/commit/6e303d8ccd4bae12a63f163dc339a5563cd9b3e1. The commits before are fine.
My own project that also uses Mbed TLS also stopped working in the same manner.
Regards,
Knut