Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOLVED] Dropbox v2 // listfolder() returns Curl-Error 51 #100

Closed
dennisheiden opened this issue Nov 27, 2017 · 2 comments
Closed

[SOLVED] Dropbox v2 // listfolder() returns Curl-Error 51 #100

dennisheiden opened this issue Nov 27, 2017 · 2 comments

Comments

@dennisheiden
Copy link

dennisheiden commented Nov 27, 2017

Dropbox Api Version: 2
SDK Version: latest (composer download / 2017-12-01)

Call:
$dropbox->listFolder("");

Warning: cURL error 51: SSL: no alternative certificate subject name matches target host name 'api.dropboxapi.com' (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Getting this message right now, don't know if something on the dropbox side changed, my api call worked hours before.

When I change api.dropboxapi.com to api.dropbox.com, the listFolder() function works but the download() returns:

Incorrect host for API function files/download. You must issue the request to content.dropboxapi.com

@dennisheiden dennisheiden changed the title cURL error 51 listfolder() returs Curl-Error Dec 1, 2017
@dennisheiden dennisheiden changed the title listfolder() returs Curl-Error listfolder() returns Curl-Error 51 Dec 1, 2017
@dennisheiden
Copy link
Author

Answer from Greg from Dropbox Support:
https://www.dropboxforum.com/t5/API-support/PHP-files-list-folder-returns-Curl-Error-51/m-p/254919

The api.dropboxapi.com host is currently being served with a valid certificate, so it's not clear why your client isn't trusting it. (Is there any security software, e.g., firewall, or a proxy that may be intefering?)

In any case, the /2/files/list_folder endpoint does need to be called on the Dropbox API servers, for which either of these host names are valid:
api.dropbox.com
api.dropboxapi.com

The /2/files/download endpoint does need to be called on the Dropbox API content servers, for which either of these host names are valid:
api-content.dropbox.com
content.dropboxapi.com

(Note that at the end of your post you mentioned "content.dropbox.com isn't available in v2". That is true in that "content.dropbox.com" is not a valid host name, but "content.dropboxapi.com" is valid and does serve API v2.)

@dennisheiden dennisheiden changed the title listfolder() returns Curl-Error 51 Dropbox v2 // listfolder() returns Curl-Error 51 Dec 4, 2017
@dennisheiden
Copy link
Author

SOLVED

The issue was in the DropboxClient.php of the SDK. the content_path was not content.dropboxapi.com .
Even after my reinstallation via composer. The GIT file is already correct: (Line 23)

https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/DropboxClient.php

@dennisheiden dennisheiden changed the title Dropbox v2 // listfolder() returns Curl-Error 51 [SOLVED] Dropbox v2 // listfolder() returns Curl-Error 51 Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants