mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-08-26 13:51:55 +00:00
add CURLOPT_SSL_VERIFYHOST/CURLOPT_SSL_VERIFYPEER options
This commit is contained in:
parent
004a5336de
commit
6e03a76ed8
@ -10,7 +10,9 @@ class Curl {
|
|||||||
int $connectTimeout = 10,
|
int $connectTimeout = 10,
|
||||||
bool $header = false,
|
bool $header = false,
|
||||||
bool $followLocation = false,
|
bool $followLocation = false,
|
||||||
int $maxRedirects = 10) {
|
int $maxRedirects = 10,
|
||||||
|
bool $sslVerifyHost = false,
|
||||||
|
bool $sslVerifyPeer = false) {
|
||||||
|
|
||||||
$this->_connection = curl_init($url);
|
$this->_connection = curl_init($url);
|
||||||
|
|
||||||
@ -26,6 +28,8 @@ class Curl {
|
|||||||
curl_setopt($this->_connection, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($this->_connection, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($this->_connection, CURLOPT_CONNECTTIMEOUT, $connectTimeout); // skip resources with long time response
|
curl_setopt($this->_connection, CURLOPT_CONNECTTIMEOUT, $connectTimeout); // skip resources with long time response
|
||||||
curl_setopt($this->_connection, CURLOPT_TIMEOUT, $connectTimeout); // prevent infinitive connection on streaming resources detected @TODO
|
curl_setopt($this->_connection, CURLOPT_TIMEOUT, $connectTimeout); // prevent infinitive connection on streaming resources detected @TODO
|
||||||
|
curl_setopt($this->_connection, CURLOPT_SSL_VERIFYHOST, $sslVerifyHost);
|
||||||
|
curl_setopt($this->_connection, CURLOPT_SSL_VERIFYPEER, $sslVerifyPeer);
|
||||||
curl_setopt($this->_connection, CURLOPT_NOPROGRESS, false);
|
curl_setopt($this->_connection, CURLOPT_NOPROGRESS, false);
|
||||||
curl_setopt($this->_connection, CURLOPT_PROGRESSFUNCTION, function(
|
curl_setopt($this->_connection, CURLOPT_PROGRESSFUNCTION, function(
|
||||||
$downloadSize, $downloaded, $uploadSize, $uploaded
|
$downloadSize, $downloaded, $uploadSize, $uploaded
|
||||||
|
Loading…
x
Reference in New Issue
Block a user