howanghk / homebridge-ewelink

Homebridge plugin to control Sonoff relays with OEM firmware
MIT License
81 stars 46 forks source link

certificate has expired #94

Closed sebbo187 closed 4 years ago

sebbo187 commented 4 years ago

Since today's update of Ewelink App on iOS the plugin unfortunately is not working any more. I sign in via OEM app and it works fine (so credentials are correct) but the login via homebridge doesn't work any longer.

I keep getting this error in the log:

[2020-5-30 18:16:08] [eWeLink] An error was encountered while requesting a list of devices. Error was [Error: certificate has expired]

and the homebridge crashes continuously.

EweLink Version: 4.1.1 Plugin Version: 0.1.21

Is there maybe any workaround for this or should I rather delete the configuration part of ewe link-max in homebridge config until a future update?

zsozso-1982 commented 4 years ago

I have the same problem! :(

jurhey commented 4 years ago

Same here.. did several resets (logging off account/logging in) still get this error: [eWeLink] An error was encountered while getting region. Error was [Error: certificate has expired] [eWeLink] An error was encountered while logging in. Error was [Error: certificate has expired] [eWeLink] An error was encountered while requesting a list of devices. Error was [Error: certificate has expired]

Thanks,

migabc commented 4 years ago

Same here (since last app update yesterday) I'm getting this error:

[eWeLink] An error was encountered while requesting a list of devices while interrogating power status. Verify your configuration options. Response was [{"error":406,"msg":"{\"error\":401,\"msg\":\"Bearer:accessToken is empty\"}"}]

dhutchison commented 4 years ago

This isn't the answer, but provides a bit more detail to the problem: Fixing the Breakage from the AddTrust External CA Root Expiration.

The eu-api.coolkit.cc server certificate chains do hit this. As I write this on my Mac, Safari is all ok with the certificate chain, but curl & openssl s_client are not. But, my calls through homebridge to the ewelink API are working (on a different test plugin at the moment though, but shouldn't be any different at this low a level).

This won't just be an issue with this plugin, or one this plugin could fix. Ultimately the api server is returning an expired certificate chain, but also it looks like for you Node is not behaving the same way as the browser to be a bit smarter about the certificate validation. For those reporting the issue, what node versions/OSs are you running? May just require a node version update.

I'm on 14.3.0 on MacOS 10.15.4

jwhits commented 4 years ago

I had the same "certificate has expired" error, I have just updated node to the latest version and it has fixed the "certificate has expired" issue for me. Plugin is back working for me

brunokelo commented 4 years ago

I had the same "certificate has expired" error, I have just updated node to the latest version and it has fixed the "certificate has expired" issue for me. Plugin is back working for me

thank you very much for the tip, it worked here too !!

jurhey commented 4 years ago

hi @dhutchison Thanks for your explanation, I'm still on node v9.11.2 / npm v6.4.1 and Mac OS 10.13

I'd rather stay on this node version since you can't simply upgrade. you need a new fresh homebridge installation in order to update the node version. Is there no other way to bypass this ?

sebbo187 commented 4 years ago

I had the same "certificate has expired" error, I have just updated node to the latest version and it has fixed the "certificate has expired" issue for me. Plugin is back working for me

Thank you for the advice. I've been on node 9.9.0 since I had to address Bluetooth Smart Home devices from my Raspberry. I changed them against native HomeKit devices short time ago so I could update node now to v12.17.0 (LTS) and the plugin is working again like a charm.

@jurhey You don't have to reinstall homebridge during the node update. Just be aware that you can't use BLE accessories with a raspberry on a higher version of node than v9.x.

sebbo187 commented 4 years ago

Here's how you update node on Raspbian safely:

sudo systemctl stop homebridge
sudo npm i npm@latest -g
sudo npm cache clean -f
sudo npm install -g n
sudo n lts
cd /usr/local/lib/node_modules/
sudo npm rebuild --unsafe-perm
sudo systemctl restart homebridge
zsozso-1982 commented 4 years ago

The update worked me too! Thank you for the help!

migabc commented 4 years ago

A simple reboot solved it for me Running:

pi@raspberrypi:~ $ date; npm -v
Mon Jun  1 19:29:20 WEST 2020
6.14.5

pi@raspberrypi:~ $ date; node -v
Mon Jun  1 19:29:29 WEST 2020
v11.15.0