Options and Features Use
104
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
Secure Socket
{
/* error... */
}
len = sl_Send(sd,"HELO server",strlen("HELO server"),0);
if
(len < 0)
{
/* error... */
}
/*...
...
... */
len = sl_Send(sd,"STARTTLS",strlen("STARTTLS"),0);
if
(len < 0)
{
/* error... */
}
len = sl_Recv(sd,buf,100,0);
if
(len < 0)
{
/* error... */
}
if
(strcmp(buf,"GO AHEAD") == 0)
{
/* we got a green light, we can start the SSL handshake */
status = sl_SetSockOpt(sd,SL_SOL_SOCKET,SL_SO_STARTTLS,&dummyVar,
sizeof
(dummyVar));
if
(status < 0)
{
/* error... */
}
/* wait for the flag to update from slcbSockEvtHdlr async event
and handle
it, if an error occurs
...
...
... */
}
/*...
...
... */
status = sl_Close(sd);
if
(status < 0)
{
/* error... */
}
}
7.5.8 Get Connection Parameters
Get the connection parameters after a successful handshake completes. The received parameters include
server certificate parameters, chosen SSL version and cipher suite, and more.
Due to a large amount of data, only 16 bytes of the issuer and subject common name are kept. The
XORed hash of those names, plus the 16-byte name strings, are helpful in verifying a wanted name.
Example:
SlSockSSLConnectionParams_t conPa;
_i16 status;
SlSocklen_t len =
sizeof
(SlSockSSLConnectionParams_t);
status = sl_GetSockOpt(SockID,SL_SOL_SOCKET,SL_SO_SSL_CONNECTION_PARAMS,&conPa,&len);
7.6
Supported Cryptographic Algorithms
lists the supported cryptographic algorithms.