-
-
Save gierschv/ab1472140bd379c489b8 to your computer and use it in GitHub Desktop.
Work-around libssl 1.0.0 - SSV3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SoapClientSSLv3 extends SoapClient { | |
protected function callCurl($url, $data) { | |
$handle = curl_init(); | |
curl_setopt($handle, CURLOPT_URL, $url); | |
curl_setopt($handle, CURLOPT_HTTPHEADER, Array('Content-Type: text/xml')); | |
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($handle, CURLOPT_POSTFIELDS, $data); | |
curl_setopt($handle, CURLOPT_SSLVERSION, 3); | |
$response = curl_exec($handle); | |
if (empty($response)) { | |
throw new SoapFault('CURL error: '.curl_error($handle), curl_errno($handle)); | |
} | |
curl_close($handle); | |
return $response; | |
} | |
public function __doRequest($request, $location, $action, $version, $one_way = 0) { | |
return $this->callCurl($location, $request); | |
} | |
} | |
$soapi = new SoapClientSSLv3('soapi-re-1.44.wsdl'); | |
$session = $soapi->login('login', 'pass', 'fr'); | |
var_dump($soapi->telephonyLineList($session, 'billing')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment