SSL: add config option for skipping common name check

Closes IDFGH-3408
Closes https://github.com/espressif/esp-mqtt/issues/158
This commit is contained in:
Marius Vikhammer
2020-06-09 14:23:40 +08:00
parent 6bc94add89
commit 5e8950e681
3 changed files with 15 additions and 1 deletions
+1
View File
@@ -182,6 +182,7 @@ typedef struct {
int clientkey_password_len; /*!< String length of the password pointed to by clientkey_password */
esp_mqtt_protocol_ver_t protocol_ver; /*!< MQTT protocol version used for connection, defaults to value from menuconfig*/
int out_buffer_size; /*!< size of MQTT output buffer. If not defined, both output and input buffers have the same size defined as ``buffer_size`` */
bool skip_cert_common_name_check; /*!< Skip any validation of server certificate CN field, this reduces the security of TLS and makes the mqtt client susceptible to MITM attacks */
} esp_mqtt_client_config_t;
/**
+2 -1
View File
@@ -31,6 +31,7 @@
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(3, 3, 0)
// Features supported from 3.3
#define MQTT_SUPPORTED_FEATURE_EVENT_LOOP
#define MQTT_SUPPORTED_FEATURE_SKIP_CRT_CMN_NAME_CHECK
#endif
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
@@ -48,4 +49,4 @@
#endif
#endif
#endif // _MQTT_SUPPORTED_FEATURES_H_
#endif // _MQTT_SUPPORTED_FEATURES_H_