ARMmbed / mbed-os-example-tls-socket

DEPRECATED: mbed TLS Socket Sample application
Apache License 2.0
4 stars 12 forks source link

Rearrange tls-related function calls and add explicit set_hostname() #44

Closed michalpasztamobica closed 4 years ago

michalpasztamobica commented 4 years ago

With https://github.com/ARMmbed/mbed-os-example-tls-socket/pull/40, the example started failing on connection. It turns out that: 1) The call order was wrong - set_ca_cert() must go before open() 2) set_hostname() is required for this connection to work (our Greentea tests work fine without it).

The second point must be considered separately, as the TLSSocket::connect was removed with the recent changes in string-based APIs, but it seems it might have to stay to call the set_hostname...