Added support to set server common name.

This commit is contained in:
Niklas Gürtler
2023-03-08 10:45:34 +01:00
committed by Euripedes Rocha
parent ffd7d4df6c
commit 6195762d28
4 changed files with 21 additions and 0 deletions
+4
View File
@@ -260,6 +260,10 @@ typedef struct esp_mqtt_client_config_t {
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 */
const char **alpn_protos; /*!< NULL-terminated list of supported application protocols to be used for ALPN */
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.
This is ignored if skip_cert_common_name_check=true. */
} verification; /*!< Security verification of the broker */
} broker; /*!< Broker address and security verification */
/**
+6
View File
@@ -64,5 +64,11 @@
#define MQTT_SUPPORTED_FEATURE_CERTIFICATE_BUNDLE
#endif
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)
// Features supported in 5.1.0
#define MQTT_SUPPORTED_FEATURE_CRT_CMN_NAME
#endif
#endif /* ESP_IDF_VERSION */
#endif // _MQTT_SUPPORTED_FEATURES_H_