photo / frontend

The official @github repository of the Trovebox frontend software. A photo sharing and photo management web interface for data stored "in the cloud" (i.e. Amazon S3, Rackspace CloudFiles, Google Storage).
https://trovebox.com
Apache License 2.0
1.38k stars 244 forks source link

LocalDropbox setup, upload fails: "Peer certificate cannot be authenticated" #1500

Open jsit opened 10 years ago

jsit commented 10 years ago

I'm seeing the following error in my PHP log when trying to upload with 4.0.0-rc5:

[Sat Jul 05 13:02:32 2014] [error] [client XXX.XXX.XXX.XXX] {severity:warn, description:"Dropbox exception from getMetaData call", additional:{file:/var/www/openphoto/src/libraries/external/Dropbox/OAuth/PHP.php, line:72, message:"making the request failed (Peer certificate cannot be authenticated with given CA certificates)", trace:"#0 /var/www/openphoto/src/libraries/external/Dropbox/OAuth/PHP.php(72): OAuth->fetch('https://api.dro...', Array, 'GET', Array)
#1 /var/www/openphoto/src/libraries/external/Dropbox/API.php(327): Dropbox_OAuth_PHP->fetch('https://api.dro...', Array)
#2 /var/www/openphoto/src/libraries/adapters/FileSystemDropboxBase.php(186): Dropbox_API->getMetaData('OpenPhoto/2014_...')
#3 /var/www/openphoto/src/libraries/adapters/FileSystemDropboxBase.php(173): FileSystemDropboxBase->putFileInDirectory('2014_07_July', '/tmp/phpWukzxS', 'test-53b82...')
#4 /var/www/openphoto/src/libraries/adapters/FileSystemLocalDropbox.php(86): FileSystemDropboxBase->putPhotos(Array)
#5 /var/www/openphoto/src/libraries/models/Photo.php(1085): FileSystemLocalDropbox->putPhotos(Array)
#6 /var/www/openphoto/src/libraries/models/Photo.php(830): Photo->createAndStoreBaseAndOriginal('test.jpg', '/tmp/phpWukzxS', 1404579752, '1')
#7 /var/www/openphoto/src/libraries/controllers/ApiPhotoController.php(473): Photo->upload('/tmp/phpWukzxS', 'test.jpg', Array)
#8 [internal function]: ApiPhotoController->upload()
#9 /var/www/openphoto/src/libraries/external/epi/EpiRoute.php(125): call_user_func_array(Array, Array)
#10 /var/www/openphoto/src/html/index.php(19): EpiRoute->run()
#11 {main}"}}, referer: http://example.com/photos/upload/beta

This might be due to a change in Dropbox's API?

jsit commented 10 years ago

When I do wget https://api.dropbox.com, I see this:

ERROR: cannot verify www.dropbox.com's certificate, issued by `/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2':
Unable to locally verify the issuer's authority.
To connect to www.dropbox.com insecurely, use `--no-check-certificate'.

Is Dropbox really using a certificate from GoDaddy? Any idea why this suddenly isn't working?

jsit commented 10 years ago

I was able to fix this with the following commands:

$ sudo wget https://ssl-tools.net/certificates/fa7798fa915a206ba743f346701c0bf02b8eb37b.pem -o /usr/local/share/ca-certificates
$ sudo update-ca-certificates