Merge pull request #60 from bfbones/master

add VERFIYPEER option to main api-request
This commit is contained in:
Tuxis Internet Engineering V.O.F 2015-10-29 09:43:46 +01:00
commit d23296e742

View file

@ -41,6 +41,9 @@ function api_request($path, $opts = null, $type = null) {
} else { } else {
curl_setopt($ch, CURLOPT_USERPWD, "$apiuser:$apipass"); curl_setopt($ch, CURLOPT_USERPWD, "$apiuser:$apipass");
} }
if ( strcasecmp( $apiproto, 'https' ) == 0 ) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $apisslverify);
}
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if ($opts) { if ($opts) {