Im still a newbie and Im trying no move working code I wrote for the ESP8266 to the ESP32 but its not working.
I have a root certificate that I have stored in SPIFFS and I want to pass it to WifiClientSecure. On the ESP8266 I do it this way (which works):
Code: Select all
// Load CA file from SPIFFS
File ca = SPIFFS.open("/site.cer", "r");
if (!ca) {
Serial.println("Failed to open ca ");
}
else
Serial.println("Success to open ca");
delay(1000);
// Set server CA file
if (wifiClient.loadCACert(ca))
Serial.println("ca loaded");
else
Serial.println("ca failed");
}
no suitable conversion function from "fs::File" to "const char *" exists
So my question is , how do I convert a File to a const char ??
Thanks
Kev