Created
July 3, 2013 12:41
-
-
Save sachintaware/5917562 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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