esp_http_client: Added support to set server common name.

pull/9803/head
Aditya Patwardhan 2022-09-06 09:00:57 +05:30 zatwierdzone przez BOT
rodzic ce32183749
commit 4904d57fd9
2 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -670,6 +670,10 @@ esp_http_client_handle_t esp_http_client_init(const esp_http_client_config_t *co
if (config->skip_cert_common_name_check) {
esp_transport_ssl_skip_common_name_check(ssl);
}
if (config->common_name) {
esp_transport_ssl_set_common_name(ssl, config->common_name);
}
#endif
if (_set_config(client, config) != ESP_OK) {

Wyświetl plik

@ -129,6 +129,9 @@ typedef struct {
bool is_async; /*!< Set asynchronous mode, only supported with HTTPS for now */
bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which this bool is set. */
bool skip_cert_common_name_check; /*!< Skip any validation of server certificate CN field */
const char *common_name; /*!< Pointer to the string containing server certificate common name.
If non-NULL, server certificate CN must match this name,
If NULL, server certificate CN must match hostname. */
esp_err_t (*crt_bundle_attach)(void *conf); /*!< Function pointer to esp_crt_bundle_attach. Enables the use of certification
bundle for server verification, must be enabled in menuconfig */
bool keep_alive_enable; /*!< Enable keep-alive timeout */