zzarbi / synology

PHP Implementation of Synology Download Station
MIT License
125 stars 58 forks source link

Problem on login with new DSM 5.1 #11

Closed gablau closed 9 years ago

gablau commented 9 years ago

Hello, thanks for you code!!! I have written a small php application that worked great. Now with the new DSM 5.1 does not make me do more access!! The following is a sample debug of login:

Connect Session: DSM User: admin Requested Url GET: https://1.1.1.1:4444/webapi/auth.cgi?account=username&passwd=plaipassword&session=DSM&format=sid&api=SYNO.API.Auth&version=2&method=login Response code: 0 Result: Errore di connessione: Connection Error

you're experiencing some problems with the new version 5.1 of dsm ?? Best Regards Gabriele

zzarbi commented 9 years ago

I have not tried connecting to 5.1 yet. I'll have to check when I get some free time.

gablau commented 9 years ago

OK, I solved the problem, I modified the file Abstract.php Line: 110 I added curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt ($ ch, CURLOPT_SSLVERSION, 0);

was an https problem!!! with these 3 lines I force not verify the validity of the SSL certificate (in case of self-signed certificate) and set SSL method of encryption to default Now it's all OK

Best Regards

zzarbi commented 9 years ago

This is actually not a problem from the library itself, in my example I use HTTP protocol, if you switch it to HTTPS and your certificate isn't valid then it will break and those 3 lines would be required to bypass SSL verification.

lucienimmink commented 9 years ago

My certificate is valid but connecting to a secured https didn't work without the SSL bypass. I need to include the SSL bypass in my project anyway since most home users won't buy a certificate.