FAILED: esp-idf/mbedtls/x509_crt_bundle 報錯的解決辦法及信息來源


2021/11/15更新:最新的esp-idf版本應該已經修復了此問題,本人嘗試了一次,直接編譯沒有問題

在使用ESP-IDF編譯工程時遇到如下報錯:

FAILED: esp-idf/mbedtls/x509_crt_bundle
cmd.exe /C "cd /D C:\Users\yahsa\Desktop\NTU\FYP\ESP_Workspace\blink\build\esp-idf\mbedtls && C:\Users\yahsa\esp.espressif\python_env\idf4.3_py3.8_env\Scripts\python.exe C:/Users/yahsa/esp/esp-idf/components/mbedtls/esp_crt_bundle/gen_crt_bundle.py --input C:/Users/yahsa/esp/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem -q"
gen_crt_bundle.py: Invalid certificate in C:/Users/yahsa/esp/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem
Invalid certificate
ninja: build stopped: subcommand failed.

這個問題是因為cacrt_all.pem文件中的一個證書最近(9月30日)過期,導致編譯工程失敗。

解決辦法為,在idf.py build編譯工程之前,輸入此命令idf.py menuconfig進行工程配置,按照如下路徑進入Certificate Bundle設置中,將Enable trusted root certificate bundle選項取消掉,即不在此工程中啟用用受信任的根證書捆綁包。

(Top) > Component config > mbedTLS > Certificate Bundle->Enable trusted root certificate bundle

在VScode中使用ESP-IDF插件也是相同的辦法,打開工程后點擊左下方齒輪⚙圖標即可進行工程配置。

解決辦法的信息來源-github鏈接


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM