net: tls: Fix mbedtls hostname erros when certificates are not used
net: tls: Fix mbedtls hostname erros when certificates are not used

When no certificate-based ciphersuites are used, mbedTLS compiles out
hostname field and associated functions from its SSL context. This
resulted in compilation error when only PSK-based ciphersuites were
configured.

This commit resolves the issue by compiling-out hostname-related code
from secure sockets implementation on the same basis as mbedTLS does.

Signed-off-by: Robert Lubos <9d28997c6894a2d0321a7bb399169af7ce99b64e@nordicsemi.no>

punitvara/zephyr,finikorg/zephyr,explora26/zephyr,finikorg/zephyr,kraj/zephyr,explora26/zephyr,nashif/zephyr,nashif/zephyr,ldts/zephyr,galak/zephyr,kraj/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,galak/zephyr,punitvara/zephyr,nashif/zephyr,ldts/zephyr,ldts/zephyr,explora26/zephyr,explora26/zephyr,galak/zephyr,nashif/zephyr,Vudentz/zephyr,kraj/zephyr,zephyrproject-rtos/zephyr,ldts/zephyr,finikorg/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,nashif/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,kraj/zephyr,punitvara/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,kraj/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,explora26/zephyr,finikorg/zephyr,Vudentz/zephyr