mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Update RestfulService so that it still functions if Curl-SSL isn't set up properly
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51211 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9ec3e2fd6e
commit
9d025c213a
@ -94,8 +94,18 @@ class RestfulService extends ViewableData {
|
||||
|
||||
$this->rawXML = curl_exec($ch);
|
||||
if($this->rawXML === false) {
|
||||
user_error("Curl Error:" . curl_error($ch), E_USER_WARNING);
|
||||
return;
|
||||
$curlError = curl_error($ch);
|
||||
// Problem verifying the server SSL certificate; just ignore it as it's not mandatory
|
||||
if(strpos($curlError,'14090086') !== false) {
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
$this->rawXML = curl_exec($ch);
|
||||
$curlError = curl_error($ch);
|
||||
}
|
||||
|
||||
if($this->rawXML === false) {
|
||||
user_error("Curl Error:" . $curlError, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
Loading…
Reference in New Issue
Block a user