Embedded TCP/IP stack  4.7.0

Detailed Description

The Transport Layer Security (TLS) protocol provides privacy and data integrity between communicating applications.
FNET uses the mbedTLS library (https://tls.mbed.org/). Its source code is placed in the fnet/third_party/mbedtls-x.x.x folder.
After the TLS context is initialized by calling the fnet_tls_init() function, the user application may create TLS sockets by calling fnet_tls_socket() and to receive/send data using fnet_tls_socket_recv() and fnet_tls_socket_send().
For the TLS server example, refer to the HTTPS server in the FNET Shell mbedTLS demo example.

Configuration parameters:

Typedefs

typedef void * fnet_tls_desc_t
 TLS context descriptor. More...
 
typedef void * fnet_tls_socket_t
 TLS socket descriptor. More...
 

Enumerations

enum  fnet_tls_role_t {
  FNET_TLS_ROLE_SERVER,
  FNET_TLS_ROLE_CLIENT
}
 TLS roles. More...
 

Functions

fnet_tls_desc_t fnet_tls_init (fnet_tls_role_t role)
 Initialize the TLS context. More...
 
fnet_return_t fnet_tls_set_own_certificate (fnet_tls_desc_t tls_desc, const fnet_uint8_t *own_certificate, fnet_size_t own_certificate_size, const fnet_uint8_t *private_key, fnet_size_t private_key_size)
 Set own certificate chain and private key. More...
 
fnet_return_t fnet_tls_set_ca_certificate (fnet_tls_desc_t tls_desc, const fnet_uint8_t *ca_certificate, fnet_size_t ca_certificate_size)
 Assign Certificate Authority certificate. More...
 
void fnet_tls_release (fnet_tls_desc_t tls_desc)
 Release the TLS context. More...
 
fnet_tls_socket_t fnet_tls_socket (fnet_tls_desc_t tls_desc, fnet_socket_t sock)
 Create the TLS socket. More...
 
void fnet_tls_socket_close (fnet_tls_socket_t tls_sock)
 Close the TLS socket. More...
 
fnet_return_t fnet_tls_socket_connect (fnet_tls_socket_t tls_sock)
 Perform the TLS handshake. More...
 
fnet_return_t fnet_tls_socket_set_hostname (fnet_tls_socket_t tls_sock, const fnet_char_t *hostname)
 Set the host name to check against the received server certificate. More...
 
fnet_ssize_t fnet_tls_socket_recv (fnet_tls_socket_t tls_sock, fnet_uint8_t *buf, fnet_size_t len)
 Receive data from a TLS socket. More...
 
fnet_ssize_t fnet_tls_socket_send (fnet_tls_socket_t tls_sock, const fnet_uint8_t *buf, fnet_size_t len)
 Send data on a TLS socket. More...
 

© 2005-2020 by Andrej Butok. http://fnet.sourceforge.net