Cannot use the https_client sample with a hostname other than example.com

Hi,

It seems like there are lots of people having issues connecting to HTTPS servers. example.com works fine, but changing HOSTNAME and certificate to something like google.com (with gtsr1.pem certificate) like the following gives a -22 error (Invalid argument) when calling connect() :

Console log:

Code:

Certificate “gtsr1.pem”:

Using “gts1c3.pem” certificate instead, I get a different error “113: Software caused connection abort”:

Do you please have any idea about why this is happening? I have tried enabling other MbedTLS options without any more luck. Kconfig files are the default ones (“prj.conf” and “overlay-tfm_mbedtls.conf”). Thanks!