forked from espressif/esp-idf
esp_http_client: Added support to set server common name.
This commit is contained in:
@@ -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) {
|
if (config->skip_cert_common_name_check) {
|
||||||
esp_transport_ssl_skip_common_name_check(ssl);
|
esp_transport_ssl_skip_common_name_check(ssl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config->common_name) {
|
||||||
|
esp_transport_ssl_set_common_name(ssl, config->common_name);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (_set_config(client, config) != ESP_OK) {
|
if (_set_config(client, config) != ESP_OK) {
|
||||||
|
@@ -129,6 +129,9 @@ typedef struct {
|
|||||||
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 */
|
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
|
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 */
|
bundle for server verification, must be enabled in menuconfig */
|
||||||
bool keep_alive_enable; /*!< Enable keep-alive timeout */
|
bool keep_alive_enable; /*!< Enable keep-alive timeout */
|
||||||
|
Reference in New Issue
Block a user