diff --git a/Splunk/Http.php b/Splunk/Http.php index ff4f9da..d7b7d50 100644 --- a/Splunk/Http.php +++ b/Splunk/Http.php @@ -157,6 +157,7 @@ class Splunk_Http CURLOPT_HEADER => TRUE, // disable SSL certificate validation CURLOPT_SSL_VERIFYPEER => FALSE, + CURLOPT_SSL_VERIFYHOST => FALSE, ); foreach ($requestHeaders as $k => $v)
I made the following patch to work around the issue.
This error indicates that curl is failing due to an HTTPS certificate validation error. (curl is used by the PHP SDK when PHP <5.3.7 to fetch HTTP(S) URLs.)
However the PHP SDK explicitly disables certificate validation in Http.php:159, so this error is rather unexpected:
private function requestWithCurl( ... CURLOPT_SSL_VERIFYPEER => FALSE,
According to the PHP docs (http://php.net/manual/en/function.curl-setopt.php), CURLOPT_SSL_VERIFYPEER, is not limited to any particular PHP version, so it is presumably available in PHP 5.3.3. Therefore it is probably getting passed through correctly to curl.
Perhaps your curl is configured in some kind of strict mode that always performs certificate validation even when instructed not to?
curl -k does work outside of the php. I can get data via the curl string but can't get the splunk_service to work in php. It maybe that the way the php is using curl on this server is not correct.... I will try to tail some more logs when i get back to this.... very strange.
So are you seeing the same error or a different one? I would not expect the original error from a login failure.
Also, your last message says that curl worked but the prior one said it did not. So I'm a bit confused.
Ok... I found that curl from the command line is working. it's disabling the cert. verification fine. The part on the sdk examples that is failing is the login. I can login with curl but the examples/index.php is not getting through the login. this is after editing the settings.local.php file with the proper credentials. Printing $SplunkExamples_connectArguments looks to be correct.
$service = new Splunk_Service($SplunkExamples_connectArguments);
// (NOTE: Can throw HTTP 401 if bad credentials)
Php 5.3.3. and Splunk 5.0.1
5.3.3 I saw a recommendation to upgrade but thought the issue pertained to localhost. I have a web server accessing the Splunk api which is on another server. I don't think we want to upgrade just yet on the php side if we don't have to.