Skip to content

AliOS Things API SSL Guide

librae8226 edited this page Mar 1, 2018 · 1 revision

API INDEX


1-mbedtls_ssl_connect

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.

2-mbedtls_ssl_send

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.

3-mbedtls_ssl_recv

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.

4-mbedtls_ssl_close

int mbedtls_ssl_close(void *ssl)
  • Description

    Close the ssl.

  • Parameters

    IN/OUT NAME DESC
    [in] ssl handle to be closed.
  • Returns

    0: success.

Clone this wiki locally