logo elektroda
logo elektroda
X
logo elektroda

[Solved] Automatic retrieval of SHA-1 key by ESP8266 in Solaredge API

bryko 459 6
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19455826
    bryko
    Level 22  
    Hi

    Based on an ESP8266 and a 5110 display, I have made myself such a small preview of the Solaredge inverter parameters. The ESP connects using the standard API over https to the Solaredge platform and downloads the data. For communication over https, the SHA-1 key is specified

    Quote:
    const char fingerprint[] PROGMEM = "69 01 51 C2 49 16 4A 38 93 FA 7C A8 E4 BC 61 9A 25 4B 98 BF";
    .

    Unfortunately every so often the key changes and the reading stops working. Is there any way for ESP to fetch the key automatically as the browser does? I am not a programmer, so I apologise in advance if the question is lame.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #3 19455884
    bryko
    Level 22  
    thank you for the quick hint, I will fight
  • Helpful post
    #4 19456115
    khoam
    Level 42  
    bryko wrote:
    Unfortunately, from time to time the key changes and the reading stops working. Is there any method for the ESP to download the key automatically as the browser does?
    .
    As the browser does, rather not, but the ESP can verify the site using the Root CA certificate of the site - this is usually valid for several years.
    Example: Link

    Tommy82 wrote:
    .
    This "advice" has nothing to do with the ESP8266. Not every link retrieved by google is suitable for advice :) .
  • ADVERTISEMENT
  • #5 19456583
    bryko
    Level 22  
    Thank you @khoam
    I was able to get the communication working using Root CA. From what I've checked in my case it's valid until XI.2031, so I'll manage without the automatic update.

    I am closing
  • ADVERTISEMENT
  • #6 19458164
    khoam
    Level 42  
    If there is a need to automatically update certificates, e.g. in the event that the ESP connects to multiple servers on the Internet, they can be downloaded and stored: Link .
  • #7 19458808
    bryko
    Level 22  
    Authorisation using Root CA was used

Topic summary

The discussion revolves around the challenge of automatically retrieving the SHA-1 key for HTTPS communication with the Solaredge API using an ESP8266 microcontroller and a 5110 display. The user initially faced issues when the SHA-1 key changed, disrupting data retrieval. A solution was proposed to use the Root CA certificate for site verification, which is typically valid for several years, thus eliminating the need for frequent key updates. The user successfully implemented this solution, confirming that the Root CA certificate is valid until XI.2031. Additional suggestions were made regarding the automatic updating of certificates for connections to multiple servers.
Summary generated by the language model.
ADVERTISEMENT