openenergymonitor / EmonESP

ESP8266 WIFI serial to emoncms link
160 stars 77 forks source link

EmonCMS HTTPs fingerprint is not treated correctly #101

Open llpamies opened 2 years ago

llpamies commented 2 years ago

I think that in emoncms.cpp, in this section:

    // Send data to Emoncms server
    String result = "";
    if (emoncms_fingerprint.isEmpty())
    {
      // HTTPS on port 443 if HTTPS fingerprint is present
      DBUGLN(F("HTTPS Enabled"));
      result =
        get_https(emoncms_fingerprint.c_str(), emoncms_server.c_str(), url,
                  443);
    }
    else
    {
      // Plain HTTP if other emoncms server e.g EmonPi
      DBUGLN(F("Plain old HTTP"));
      result = get_http(emoncms_server.c_str(), url);
    }

The condition should instead be:

    if (!emoncms_fingerprint.isEmpty())
qm3ster commented 2 years ago

Fixed in https://github.com/openenergymonitor/EmonESP/pull/102