Closed jeremyvisser closed 3 years ago
Thanks @jeremyvisser! The library is mainly used with homeassistant, where the aiohttp session has verify_ssl false.
But this should make the example work on its own as well
Does this have any negative impact on http:// requests?
My Sunny Boy 5.0 inverter appears to force HTTPS (it redirects HTTP to HTTPS) and I don’t see any options within the interface to allow HTTP access, so testing it isn’t really possible with my inverter.
(I tested against a HTTP interface and it made actual requests, but those requests weren’t to a real inverter. Based on that I’d say it’ll probably work, but I’d recommend additionally testing yourself.)
I dont have the inverter myself any longer, but if you made successful requests to http it should be ok.
SMA Inverters use self-signed certificates which are untrusted by default on Python.
Without this change, attempting to use example.py with HTTPS fails with:
With this change, connecting works as expected.
In an ideal world, using a trusted TLS certificate would be the best fix. However, I'm unaware of a way to upload a trusted TLS cert to an SMA inverter. As such, setting verify_ssl=False seems to be the only practical way to use HTTPS with this hardware.