How to establish a SSL/TLS socket connection with X-CUBE-CELLULAR v6.0.1?
I'm updating X-CUBE-CELLULAR in my project from v3.0.0 to v6.0.1, but I haven't found documentation or examples to create secure sockets.
With v3, it was as simple as follows:
bool tls = (pCtx->protocol==HTTP_PROTO_HTTPS);
pCtx->sock = net_socket(NET_AF_INET, NET_SOCK_STREAM, NET_IPPROTO_TCP);
if(tls == true)
{
ret = net_setsockopt(pCtx->sock, NET_SOL_SOCKET, NET_SO_SECURE, NULL, 0);
}With v6, I manage to create the socket, but I can't find secure options:
pCtx->sock = com_socket(COM_AF_INET, COM_SOCK_STREAM, COM_IPPROTO_TCP);I find hard to believe this feature is not supported since nowadays most of IoT communications require SSL certificates.
Please, can you confirm that it is possible? In that case, I really would appreciate if you provide an example to create secure sockets.
My project is configured to use modem sockets type (USE_SOCKETS_MODEM).
I've also tried LwIP sockets type (USE_SOCKETS_LWIP), but I can't set secure options through the socket API either. Nonetheless, I found this example (not yet tested) to work with LwIP + mbedTLS: LWIP + Mbedtls SSL + SMTP email client (st.com)
All things considered, I still prefer modem sockets in order to free resources in the MCU, so it would be the ideal solution.
@S.RA, It seems you are the right person to ask. Thank you in advance for your help.
Regards,
Viviana
