Related SDK and Issue:
https://github.com/kunalvarma05/dropbox-php-sdk/issues/100
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)
Test Script
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.dropboxapi.com/2/files/list_folder");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CAINFO, "cacert.pem");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"path\":\"\"}");
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = "Authorization: Bearer <TOKEN>";
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
var_dump($result);
When I use api.dropbox.com, /files/list_folder works, but not /files/download:
Incorrect host for API function files/download. You must issue the request to content.dropboxapi.com
Needless to say that content.dropbox.com isn't available in v2.