Home › Forums › Mayfly Data Logger › EspressifESP32 › Reply To: EspressifESP32
2026-08-04 at 6:31 PM
#19769
I am using EnviroDIY fork. Until now everything is working. I am able to make both http post, and mqtt connection.
I checked and mine esp32 firmware version is 2.4.0. So,Is it because of this lower version, I had to do some hack around for ssl connection?
Below is the part of workaround I coded to make it work with hydroserver.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
void ExpressifESP32::extraSetupForHTTPS(const char* host, const int port) { // Some HTTPS servers(like playground instance of hydroserver) host multiple domains on the same IP address. // During the TLS handshake, the modem must send the hostname using // Server Name Indication so the server can present the correct // SSL/TLS certificate. Without SNI, the connection may fail even // though DNS resolution and TCP connectivity succeed. _modem.sendAT(GF("+CIPRECVMODE=1")); // Ref: https://docs.espressif.com/projects/esp-at/en/release-v2.4.0.0/esp32/AT_Command_Set/TCP-IP_AT_Commands.html#at-cipsslcsni-query-set-ssl-client-server-name-indication-sni _modem.sendAT(GF("+CIPSSLCSNI=0,\""), host, GF("\"")); _modem.sendAT(GF("+CIPSSLCSNI=1,\""), host, GF("\"")); delay(3000); // See : https://docs.espressif.com/projects/esp-at/en/latest/esp32/AT_Command_Set/TCP-IP_AT_Commands.html#cmd-start // same as above. This also need to be done twice _modem.sendAT(GF("+CIPSTART=0,\"SSL\",\""), host, GF("\","), port); _modem.sendAT(GF("+CIPSTART=1,\"SSL\",\""), host, GF("\","), port); } |
Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of