Chapter 2. API Reference
(continued from previous page)
SSL *ssl;
const unsigned char *buf;
long len;
... ...
ret = SSL_use_certificate_ASN1(ssl, len, buf);
}
4.12 X509* SSL_get_peer_certificate (const SSL * ssl)
Arguments:
ssl - SSL point
Return:
peer certification
Description:
get peer certification
Example:
void example(void)
{
SSL *ssl;
X509 *peer;
... ...
peer = SSL_get_peer_certificate(ssl);
}
2.3.5 ESP HTTP Client
Overview
esp_http_client provides an API for making HTTP/S requests from ESP-IDF programs. The steps to use this
API for an HTTP request are:
• esp_http_client_init(): To use the HTTP client, the first thing we must do is create an
esp_http_client by pass into this function with the esp_http_client_config_t configurations.
Which configuration values we do not define, the library will use default.
• esp_http_client_perform(): The esp_http_client argument created from the init function is
needed. This function performs all operations of the esp_http_client, from opening the connection, sending
data, downloading data and closing the connection if necessary. All related events will be invoked in the
event_handle (defined by esp_http_client_config_t). This function performs its job and blocks the
current task until it’s done
• esp_http_client_cleanup(): After completing our esp_http_client’s task, this is the last function
to be called. It will close the connection (if any) and free up all the memory allocated to the HTTP client
Application Example
Espressif Systems 557
Submit Document Feedback
Release v4.4