forked from espressif/esp-idf
esp_http_client: Add support to disable validation of certificate's CN field
This commit is contained in:
@@ -506,6 +506,10 @@ esp_http_client_handle_t esp_http_client_init(const esp_http_client_config_t *co
|
|||||||
if (config->client_key_pem) {
|
if (config->client_key_pem) {
|
||||||
esp_transport_ssl_set_client_key_data(ssl, config->client_key_pem, strlen(config->client_key_pem));
|
esp_transport_ssl_set_client_key_data(ssl, config->client_key_pem, strlen(config->client_key_pem));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config->skip_cert_common_name_check) {
|
||||||
|
esp_transport_ssl_skip_common_name_check(ssl);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (_set_config(client, config) != ESP_OK) {
|
if (_set_config(client, config) != ESP_OK) {
|
||||||
|
@@ -118,6 +118,7 @@ typedef struct {
|
|||||||
void *user_data; /*!< HTTP user_data context */
|
void *user_data; /*!< HTTP user_data context */
|
||||||
bool is_async; /*!< Set asynchronous mode, only supported with HTTPS for now */
|
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 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 */
|
||||||
} esp_http_client_config_t;
|
} esp_http_client_config_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user