Merge branch 'feature/esp_http_client_mutual_auth_backport_v3.2' into 'release/v3.2'

esp_http_client: Add support for mutual authentication (backport v3.2)

See merge request idf/esp-idf!5026
This commit is contained in:
Angus Gratton 2019-05-27 13:16:47 +08:00
commit 4b5be79c0c
2 changed files with 11 additions and 1 deletions

View file

@ -495,6 +495,14 @@ esp_http_client_handle_t esp_http_client_init(const esp_http_client_config_t *co
} else if (config->cert_pem) {
esp_transport_ssl_set_cert_data(ssl, config->cert_pem, strlen(config->cert_pem));
}
if (config->client_cert_pem) {
esp_transport_ssl_set_client_cert_data(ssl, config->client_cert_pem, strlen(config->client_cert_pem));
}
if (config->client_key_pem) {
esp_transport_ssl_set_client_key_data(ssl, config->client_key_pem, strlen(config->client_key_pem));
}
#endif
if (_set_config(client, config) != ESP_OK) {

View file

@ -105,7 +105,9 @@ typedef struct {
esp_http_client_auth_type_t auth_type; /*!< Http authentication type, see `esp_http_client_auth_type_t` */
const char *path; /*!< HTTP Path, if not set, default is `/` */
const char *query; /*!< HTTP query */
const char *cert_pem; /*!< SSL Certification, PEM format as string, if the client requires to verify server */
const char *cert_pem; /*!< SSL server certification, PEM format as string, if the client requires to verify server */
const char *client_cert_pem; /*!< SSL client certification, PEM format as string, if the server requires to verify client */
const char *client_key_pem; /*!< SSL client key, PEM format as string, if the server requires to verify client */
esp_http_client_method_t method; /*!< HTTP Method */
int timeout_ms; /*!< Network timeout in milliseconds */
bool disable_auto_redirect; /*!< Disable HTTP automatic redirects */