]> granicus.if.org Git - esp-idf/commitdiff
example/simple_ota_example: Add support for skipping OTA server certificate CN field
authorJitin George <jitin@espressif.com>
Wed, 12 Jun 2019 08:45:06 +0000 (14:15 +0530)
committerbot <bot@espressif.com>
Tue, 25 Jun 2019 23:41:33 +0000 (23:41 +0000)
examples/system/ota/simple_ota_example/main/Kconfig.projbuild
examples/system/ota/simple_ota_example/main/simple_ota_example.c
examples/system/ota/simple_ota_example/sdkconfig.ci

index 08f7f3d73880e1fc0bf1df3c51f21e4cd7d8367d..be4b8379db5f0bc0396dc447e454bc5992f08627 100644 (file)
@@ -1,13 +1,20 @@
 menu "Example Configuration"
 
-    config FIRMWARE_UPGRADE_URL
+    config EXAMPLE_FIRMWARE_UPGRADE_URL
         string "firmware upgrade url endpoint"
         default "https://192.168.0.3:8070/hello-world.bin"
         help
             URL of server which hosts the firmware
             image.
 
-    config FIRMWARE_UPGRADE_URL_FROM_STDIN
+    config EXAMPLE_FIRMWARE_UPGRADE_URL_FROM_STDIN
         bool
         default y if FIRMWARE_UPGRADE_URL = "FROM_STDIN"
+
+    config EXAMPLE_SKIP_COMMON_NAME_CHECK
+        bool "Skip server certificate CN fieldcheck"
+        default n
+        help
+            This allows you to skip the validation of OTA server certificate CN field.
+
 endmenu
index 965403a9d3af9b45c6836ca33f4249af99b18a0a..e3d521670e10c6763e2525bf3005c03865a16531 100644 (file)
@@ -80,6 +80,10 @@ void simple_ota_example_task(void *pvParameter)
     }
 #endif
 
+#ifdef CONFIG_SKIP_COMMON_NAME_CHECK
+    config.skip_cert_common_name_check = true;
+#endif
+
     esp_err_t ret = esp_https_ota(&config);
     if (ret == ESP_OK) {
         esp_restart();
index 813b3adac3729806030584c18be1d84598292e5b..6d493cbf12ddf69d78d45fcf4a834f8b24d7d52b 100644 (file)
@@ -1 +1,2 @@
 CONFIG_FIRMWARE_UPGRADE_URL="FROM_STDIN"
+CONFIG_SKIP_COMMON_NAME_CHECK=y