I'm trying to call a SOAP API through a proxy. And I'm using cURL for that in my PHP script. It works fine for WSDL files with no SSL. But when trying to access WSDL files over "https" it throws the following error.
"error:1421C105:SSL routines:set_client_ciphersuite:wrong cipher returned"
This same error is thrown even if I used Guzzle.
Here's my cURL script.
$ch = curl_init();
$timeout = 1000;
curl_setopt($ch, CURLOPT_URL, "https://<ip-here>:8080/wsdl/file/url");
//Tell cURL where our certificate bundle is located.
$certificate = "C:/xampp/cacert.pem";
curl_setopt($ch, CURLOPT_CAINFO, $certificate);
curl_setopt($ch, CURLOPT_CAPATH, $certificate);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_PROXY, "http://localhost:1338");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HTTP_VERSION, 'CURL_HTTP_VERSION_1_1');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: text/xml']);
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'DEFAULT@SECLEVEL=1');
curl_setopt($ch, CURLOPT_POSTFIELDS, '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rm="rm:soap">
<soapenv:Header/>
<soapenv:Body>
<rm:getGroupMemberList>
<inPara>
<subscriberGroupMemberQuota>
<attribute>
<key>GRPIDENTIFIER</key>
<value>420722009813</value>
</attribute>
</subscriberGroupMemberQuota>
</inPara>
</rm:getGroupMemberList>
</soapenv:Body>
</soapenv:Envelope>
');
$data = curl_exec($ch);
if ($data === false) {
dd(curl_error($ch));
throw new Exception(curl_error($ch), curl_errno($ch));
}
curl_close($ch);
I tried everything mentioned in the previous answers in SO. Can you guys see what's wrong with this request ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…