Skip to content

Instantly share code, notes, and snippets.

@sachintaware
Created July 3, 2013 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sachintaware/5917562 to your computer and use it in GitHub Desktop.
Save sachintaware/5917562 to your computer and use it in GitHub Desktop.
--- production/lib/requestcore/requestcore.class.php 2011-04-05 15:56:58.000000000 -0700
+++ development/lib/requestcore/requestcore.class.php 2011-04-21 16:28:40.000000000 -0700
@@ -590,39 +590,44 @@
* @return resource The handle for the cURL object.
*/
public function prep_request()
{
$curl_handle = curl_init();
// Set default options.
curl_setopt($curl_handle, CURLOPT_URL, $this->request_url);
curl_setopt($curl_handle, CURLOPT_FILETIME, true);
curl_setopt($curl_handle, CURLOPT_FRESH_CONNECT, false);
- curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, true);
curl_setopt($curl_handle, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
curl_setopt($curl_handle, CURLOPT_MAXREDIRS, 5);
curl_setopt($curl_handle, CURLOPT_HEADER, true);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_handle, CURLOPT_TIMEOUT, 5184000);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($curl_handle, CURLOPT_NOSIGNAL, true);
curl_setopt($curl_handle, CURLOPT_REFERER, $this->request_url);
curl_setopt($curl_handle, CURLOPT_USERAGENT, $this->useragent);
curl_setopt($curl_handle, CURLOPT_READFUNCTION, array($this, 'streaming_read_callback'));
+ // Verify security of the connection
+ curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, true);
+ curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, true);
+ curl_setopt($curl_handle, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem'); // chmod the file as 755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment