Skip to content

esp-tls-mbedtls: No server verification option set in esp_tls_cfg_t structure. Check esp_tls API reference #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zonmen opened this issue Jul 11, 2021 · 3 comments

Comments

@zonmen
Copy link
Owner

zonmen commented Jul 11, 2021

I use esp32, idf sdk and when tried to make simple http request I saw that problem. I coludn't do this, because don't use any certification. After an hour I was able to fix it. I am new on this platform and programming mcu, so it's guide just for those who like me, don't understand most of idf and ide config and just started in it

@zonmen
Copy link
Owner Author

zonmen commented Jul 11, 2021

problem is: As I understood, idf updated and now when you use Internet requests you need to server cert verification
heading ESP-TLS in https://newreleases.io/project/github/espressif/esp-idf/release/v4.3-beta1

solve: In project folder(root folder) we need to change "sdkconfig" file. In menu choose Component config->ESP LTS-> (enable these options) "Allow potentially insecure options" and then "Skip server verification by default". I did it in my ide(eclipse).
or way for die-hard(using menuconfig in terminal, on my example):

1. Go to root derictory esp-idf in terminal

~/programs/eclipse_work-space/my_libs/esp-idf-v4.3

2. Run file "install.sh"

//I use ubuntu, so first of all, I did this file executable

chmod +x install.sh

//and run

./install.sh

3.Then run "export.sh"

//this file we need to run like source(?), so I just ran this

. ./export.sh

4.Go to folder /tools (into the root esp-idf/)

cd tools

5.Make "idf.py" executable(this is file in tools folder)

cd tools

//one more time in my case

chmod +x idf.py

6. Go to your current project and do "idf.py menuconfig"

cd ~/programs/eclipse_work-space/whole_project

idf.py menuconfig

//it opens a menu to config your project

7. Navigation in menu

Component config->ESP-TLS->(enable these) "Allow potentially insecure options" and THEN "Skip server certificate verification by default (WARNING ...)"

8. Save and quit

Work is done!

Links:

  1. answers(but I couldn't find this config file):
    https://www.esp32.com/viewtopic.php?t=19200
    Compile this with ESPIDF v4.2.1 instead of v4.4 espressif/arduino-esp32#5176
  2. Generall information about esp idf configuration:
    https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#component-config

@zonmen zonmen closed this as completed Jul 11, 2021
@zonmen
Copy link
Owner Author

zonmen commented Jul 31, 2021

OK, i find my problem.
Just add these lines to your sdkconfig.defaults file:
CONFIG_ESP_TLS_INSECURE=y
CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY=y

xpress-embedo added a commit to xpress-embedo/ESP32 that referenced this issue Jul 5, 2023
* When Connection to router is successful openweather_task is created
* In this task we form the URL, and then perform this client request
* in the event handler function we will till the data is received, and then we delete this task
* now in the openweathermap_event_handler function we have to decode/extract the weather information data

I also faced a problem, which is described below.
Faced an issue "esp-tls-mbedtls: No server verification option set in esp_tls_cfg_t structure"
Which is fixed using this link
zonmen/IndoorSolution-esp32#1
CONFIG_ESP_TLS_INSECURE=y
CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY=y
@hayathms
Copy link

Thanks a lot @zonmen ,
changing sdkconfig file helped me, thanks a lot,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants