SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
Set the domain name to verify the desired domain during the TLS handshake. The domain verification is used to help against "man in the middle" attacks, where a third party could buy a fake certificate from the same root CA that signed the certificate of the server, and redirect the traffic to their server. Besides the full chain verification, TI recommends checking the domain name as well. This option is only available for client mode. This option should be called before sl_Connect or sl_Listen. Setting a domain name also enables the SNI extension in the client hello message, according to RFC 6066.
Example:
_i16 status;
Status = sl_SetSockOpt(SockID, SL_SOL_SOCKET,_SL_SO_SECURE_DOMAIN_NAME_VERIFICATION,
"www.google.com",strlen("www.google.com"));