AliOS Things API SSL Guide - Shaofa/AliOS-Things-Certification-Manual GitHub Wiki
void *mbedtls_ssl_connect(void *tcp_fd, const char *ca_cert, int ca_cert_len)
-
Description
Create a ssl connect.
-
Parameters
IN/OUT NAME DESC [in] tcp_fd handle of the tcp socket. [in] ca_cert CA. [in] ca_cert_len length of the CA. -
Returns
NULL: error; ssl_param: success.
int mbedtls_ssl_send(void *ssl, const char *buffer, int length)
-
Description
Send data through ssl.
-
Parameters
IN/OUT NAME DESC [in] ssl handle of the ssl. [in] buffer data to send. [in] length length of the data. -
Returns
-1: error; others: length of the data be sended.
int mbedtls_ssl_recv(void *ssl, char *buffer, int length)
-
Description
Recv data through ssl.
-
Parameters
IN/OUT NAME DESC [in] ssl handle of the ssl. [in] buffer buffer to recv data. [in] length the max size of the buffer. -
Returns
-1: error; 0: EOF; others: length of the data be sended.
int mbedtls_ssl_close(void *ssl)
-
Description
Close the ssl.
-
Parameters
IN/OUT NAME DESC [in] ssl handle to be closed. -
Returns
0: success.