stfnhmplr / homebridge-synology

Control your Synology Diskstation with Homekit
MIT License
162 stars 16 forks source link

Can't login #24

Closed Patrick1610 closed 2 years ago

Patrick1610 commented 7 years ago

Hi,

When i run this plugin i het the error that the login fails. I use my admin account and am 100% sure that the password is correct in the config file. What could be going wrong?

Patrick

stfnhmplr commented 7 years ago

Hi Patrick,

did you check the other config options as well? Is the accessory displaying the power state correctly? Do you use 2FA (not supported)? The other config options should match your diskstations webinterface url, i.e. http[s for secure=true]://your-ip:port.

I just added some more hints to the readme on github. Maybe you take a look.

regards

Patrick1610 commented 7 years ago

Hi, Thanks for your reply and the updated readme. My settings where port: 5001, secure: true, version: 6, disabled: switch

What is 2FA?

Patrick

stfnhmplr commented 7 years ago

2FA = two factor authentication.

The disabled option at the config should be an array even when you select only one option. So it should be "disabled": ["switch"] Maybe you can try it first without any disabled option. The other parts of the config are fine.

Patrick1610 commented 7 years ago

Thanks! 2FA is not enabled and even without the disabled line the error remains, any other ideas?

On 8 Jun 2017, at 09:03, stfnhmplr notifications@github.com wrote:

2FA = two factor authentication.

The disabled option at the config should be an array even when you select only one option. So it should be "disabled": ["switch"] Maybe you can try it first without any disabled option. The other parts of the config are fine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

stfnhmplr commented 7 years ago

No, not for now. I will create an update next week which will add the synology error codes to the log.

Patrick1610 commented 7 years ago

Great, I'll wait for the update and check after that! Do I have to reinstall or update the package manually?

stfnhmplr commented 7 years ago

Yes, should work with npm update -g homebridge-synology. But it's also possible to remove the package manually and install it again.

CooperCGN commented 7 years ago

Hello, great add-on... two things, if I add the disabled switch "state" shutdown for some reason doesn't work anymore. Also it would be awesome if there could be some status update in homekit if I just start my DS by pressing the power button.

stfnhmplr commented 7 years ago

@Patrick1610 You can grab the update via npm now. Any login errors should be added to the log file. You'll find a short description for each code here (page 16)

@CooperCGN I think your question is not related to this topic. But i'll answer it anyway. If you add switch to the disabled property, you disable the switch function. So you can not start or shutdown it anymore. For status polling take a look at #4 please.

HajLender commented 7 years ago

Hi, I am always getting the following error: 

[37m[7/2/2017, 5:44:28 PM] [Diskstation] An error occured while getting SystemTemp: Can't login to Diskstation. unable to verify the first certificate

2FA is not enabled.

Can anybody help?

Thank you in advance

stfnhmplr commented 7 years ago

Hi. Do you use a self-signed SSL certificate? Looks like DSM does not send the intermediate certificate or your certificate is misconfigured, so homebridge can't verify it.

HajLender commented 7 years ago

Thank you very much for. A quick response. Sorry I am a complete noob the theme but I checked the control panel/security/certficate pane on my synology and I found a certificate issued by Synology only...

stfnhmplr commented 7 years ago

I think thats the problem. Synology does not send the intermediate certificate so the request module can't verify it. I found a package that can solve the issue without affecting the security. But i have to try it first. Will take a few days.

ramsnerm commented 7 years ago

Any news regarding the self sign ssl?

stfnhmplr commented 7 years ago

Not really. I created a self signed certificate for my DS. But it works without any changes. I can't reproduce the error. Do you have the same issue with the same error message like @HajLender?

I created a new branch 'ssl' with a possible solution. Maybe you can checkout this branch and try it.

HajLender commented 7 years ago

Hi, I tried to get rid of the synology certificate, but no success... And still not working

stfnhmplr commented 7 years ago

Did you try the ssl-branch already?

ramsnerm commented 7 years ago

Hi, I have no error message at all. I only do not receive any data (correct power state, temperature, ...). If I change over to secure = false with the correct port all data are shown. Back to the secure = true settings no more data are shown. Any idea whats wrong?

For confirmation if I use the HTTP access I get my configured warning "user logged in" with HTTPS no message is give so I assume the secure login is not working.

What should be the difference in the SSL brache because according GIT it is identical to the master branch. screenshot juli 19 21 58 04

ramsnerm commented 7 years ago

One more note: If i install this plugin the plugin "devolo" starts to crash and stops working my homebridge.

stfnhmplr commented 7 years ago

Sorry, forgot to push the changes. I added a request option for unauthorized certificates. You can try the ssl-branch now.

That's weird. If the login fails, there should be at least one error message with an specific error code. But when it works without ssl, are you sure you enabled the ssl at your synology?

I use the plugin with many others and it does not crash. Maybe it's the devolo plugin? But without a error message I can only guess ...

ramsnerm commented 7 years ago

Hi, I tested today the SSL branch and I am now able to login. The power state is correctly shown but I am not able to shutdown the Station as Temperature and Stats are not shown in EVE (only 0%, 0°C, ...).

stfnhmplr commented 7 years ago

Ok. Are you on DSM 6.1.x? I think they changed their API again.

ramsnerm commented 7 years ago

Yes you are right. Currently I have DSM Version 6.1.3-15152 Update 2 on a Synology NAS 415 and DS1815+ installed.

stfnhmplr commented 7 years ago

Then it's the new API. I don't have much time right now. An update will take some time. PR is welcome.

kikeenrique commented 7 years ago

I applied the ssl branch modifications and still not working. Currently using 6.1.3.x and logs shows message: [Diskstation Synology] An error occured while getting SystemTemp: Can't login to Diskstation. unable to verify the first certificate.

kikeenrique commented 7 years ago

Is there any new API documentation? Where can I get info/documentation to help fix this errors?

TheDoudou commented 6 years ago

Hi me too the same problem for temperature 0° (celsius ?).

Work with http but not with https.

stfnhmplr commented 6 years ago

please try the latest release. It should fix the problems with the self-signed certificates. Tested with a DS211j.

kikeenrique commented 6 years ago

It's working for me.

I took a look at the fix and found out that setting rejectUnauthorized is redundant to setting strictSSL. (https://github.com/request/request/blob/master/request.js#L254)

Regards