forked from espressif/esp-idf
feat: Add domain match to wifi_enterprise example
This commit is contained in:
committed by
Kapil Gupta
parent
2848e999df
commit
1cfc4a4ede
@@ -99,4 +99,16 @@ menu "Example Configuration"
|
|||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Use default CA certificate bundle for WiFi enterprise connection
|
Use default CA certificate bundle for WiFi enterprise connection
|
||||||
|
|
||||||
|
config EXAMPLE_USE_SERVER_DOMAIN_MATCH
|
||||||
|
bool "Validate server cert domain"
|
||||||
|
help
|
||||||
|
Validate the certificate domain
|
||||||
|
|
||||||
|
config EXAMPLE_SERVER_DOMAIN_MATCH_VALUE
|
||||||
|
string "Server cert domain"
|
||||||
|
depends on EXAMPLE_USE_SERVER_DOMAIN_MATCH
|
||||||
|
default "espressif.com"
|
||||||
|
help
|
||||||
|
Accept only server certificates matching this domain
|
||||||
endmenu
|
endmenu
|
||||||
|
@@ -155,6 +155,9 @@ static void initialise_wifi(void)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_EXAMPLE_USE_DEFAULT_CERT_BUNDLE
|
#ifdef CONFIG_EXAMPLE_USE_DEFAULT_CERT_BUNDLE
|
||||||
ESP_ERROR_CHECK(esp_eap_client_use_default_cert_bundle(true));
|
ESP_ERROR_CHECK(esp_eap_client_use_default_cert_bundle(true));
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_EXAMPLE_USE_SERVER_DOMAIN_MATCH
|
||||||
|
ESP_ERROR_CHECK(esp_eap_client_set_domain_match(CONFIG_EXAMPLE_SERVER_DOMAIN_MATCH_VALUE));
|
||||||
#endif
|
#endif
|
||||||
ESP_ERROR_CHECK(esp_wifi_sta_enterprise_enable());
|
ESP_ERROR_CHECK(esp_wifi_sta_enterprise_enable());
|
||||||
ESP_ERROR_CHECK(esp_wifi_start());
|
ESP_ERROR_CHECK(esp_wifi_start());
|
||||||
|
Reference in New Issue
Block a user