Added possibility to switch off/on SSL verify peer option using Unirest::$verifyPeer #27
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
|
||||
class Unirest
|
||||
{
|
||||
/**
|
||||
* Verify SSL peer
|
||||
* @var bool
|
||||
*/
|
||||
public static $verifyPeer = true;
|
||||
|
||||
private static $socketTimeout = null;
|
||||
private static $defaultHeaders = array();
|
||||
@@ -151,7 +156,7 @@
|
||||
curl_setopt ($ch, CURLOPT_MAXREDIRS, 10);
|
||||
curl_setopt ($ch, CURLOPT_HTTPHEADER, $lowercaseHeaders);
|
||||
curl_setopt ($ch, CURLOPT_HEADER, true);
|
||||
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, Unirest::$verifyPeer);
|
||||
curl_setopt ($ch, CURLOPT_ENCODING, ""); // If an empty string, "", is set, a header containing all supported encoding types is sent.
|
||||
if (Unirest::$socketTimeout != null) {
|
||||
curl_setopt ($ch, CURLOPT_TIMEOUT, Unirest::$socketTimeout);
|
||||
|
||||
Reference in New Issue
Block a user