readme
This commit is contained in:
10
README.md
10
README.md
@@ -146,3 +146,13 @@ You can clear the default headers anytime with:
|
|||||||
```php
|
```php
|
||||||
Unirest::clearDefaultHeaders();
|
Unirest::clearDefaultHeaders();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### SSL validation
|
||||||
|
|
||||||
|
You can esplicitly enable or disable SSL certificate validation
|
||||||
|
|
||||||
|
```php
|
||||||
|
Unirest::verifiyPeer(false);
|
||||||
|
```
|
||||||
|
|
||||||
|
By default is `true`.
|
||||||
|
|||||||
@@ -5,15 +5,20 @@
|
|||||||
|
|
||||||
class Unirest
|
class Unirest
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Verify SSL peer
|
private static $verifyPeer = true;
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
public static $verifyPeer = true;
|
|
||||||
|
|
||||||
private static $socketTimeout = null;
|
private static $socketTimeout = null;
|
||||||
private static $defaultHeaders = array();
|
private static $defaultHeaders = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify SSL peer
|
||||||
|
* @param bool $enabled enable SSL verification, by default is true
|
||||||
|
*/
|
||||||
|
public static function verifyPeer($enabled) {
|
||||||
|
Unirest::$verifyPeer = $enabled;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a timeout
|
* Set a timeout
|
||||||
* @param integer $seconds timeout value in seconds
|
* @param integer $seconds timeout value in seconds
|
||||||
|
|||||||
Reference in New Issue
Block a user