Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
secure

Converts an (insecure) TCP connection with a remote server into a secure TLS-over-TCP connection.

It may be called after both of the following:

Functions

sint8 secure (SOCKET sock)
 

sint8 secure ( SOCKET  sock)
Parameters
[in]sockSocket ID, corresponding to a connected TCP socket.
Precondition
socket and connect must be called to connect a TCP socket before passing the socket ID to this function. Value SOCKET_CONFIG_SSL_DELAY must have been set in the u8Config parameter that was passed to socket.
See Also
socket connect
Returns
The function returns SOCK_ERR_NO_ERROR for successful operations and a negative error value otherwise. The possible error values are:

References MAX_SOCKET, NULL, tstrConnectCmd::sock, SOCK_ERR_INVALID, SOCK_ERR_INVALID_ARG, SOCK_ERR_NO_ERROR, SOCKET_CMD_SECURE, SOCKET_REQUEST, SSL_FLAGS_ACTIVE, SSL_FLAGS_DELAY, tstrSocket::u16SessionID, tstrConnectCmd::u16SessionID, tstrSocket::u8SSLFlags, and tstrConnectCmd::u8SslFlags.