When compiling a fresh checkout for ESP32 (esp32dev), I am getting the following error:
Compiling .pio\build\esp32dev\lib694\WiFi\WiFiGeneric.cpp.o
.../ESP-MQTT-AWS-IoT-Core/Arduino/MQTT/MQTT.ino: In function 'void connectToMqtt(bool)':
.../ESP-MQTT-AWS-IoT-Core/Arduino/MQTT/MQTT.ino:133:26: error: 'class WiFiClientSecure' has no member named 'getLastSSLError'
Serial.println(net.getLastSSLError());
When compiling a fresh checkout for ESP32 (esp32dev), I am getting the following error:
The offending line https://github.com/debsahu/ESP-MQTT-AWS-IoT-Core/blob/64817e28b0a7ca295af926a6c352a9b4d51ee15e/Arduino/MQTT/MQTT.ino#L133
is referring to code that is only available in the ESP8266 WiFiClientSecure (BearSSL) implementation:
https://github.com/esp8266/Arduino/blob/c3c61a5f751fcc75440e571b5aa89254dce6e4f7/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h#L115-L116
For ESP32, BearSSL is not used (not available). Would
net.lastError()
be the correct alternative?https://github.com/espressif/arduino-esp32/blob/b92c58d74b151c7a3b56db4e78f2d3c90c16446f/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp#L322-L331
If so, then the implementation could work like this: