/** * Creates new http Request object * * @return Request Returns new http Request object */ protected function createHttpRequest() { $req = new Request(); $req->setOptions(['redirect' => 10, 'cookiesession' => true]); $req->setSslOptions(['verifypeer' => false, 'verifyhost' => false]); $proxySettings = $this->cloudstack->getProxy(); if ($proxySettings !== false) { $req->setOptions(['proxyhost' => $proxySettings['host'], 'proxyport' => $proxySettings['port'], 'proxytype' => $proxySettings['type']]); if ($proxySettings['user']) { $req->setOptions(['proxyauth' => "{$proxySettings['user']}:{$proxySettings['pass']}", 'proxyauthtype' => $proxySettings['authtype']]); } } return $req; }