Skip to content

Instantly share code, notes, and snippets.

@kejyun
Created December 13, 2012 15:26
Show Gist options
  • Save kejyun/4277117 to your computer and use it in GitHub Desktop.
Save kejyun/4277117 to your computer and use it in GitHub Desktop.
Facebook PHP SDK SSL Exception
<?php
//before
if (curl_errno($ch) == 60) { // CURLE_SSL_CACERT
self::errorLog('Invalid or no certificate authority found, '.
'using bundled information');
curl_setopt($ch, CURLOPT_CAINFO,
dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
$result = curl_exec($ch);
}
//after
if (curl_errno($ch) == 60) { // CURLE_SSL_CACERT
$opts[CURLOPT_SSL_VERIFYPEER] = false;
$opts[CURLOPT_SSL_VERIFYHOST] = 2;
curl_setopt_array($ch, $opts);
$result = curl_exec($ch);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment