<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trying to find instructions to correct this problem with using the SDK examples for PHP in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57591#M781</link>
    <description>&lt;P&gt;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.  &lt;/P&gt;

&lt;P&gt;$service = new Splunk_Service($SplunkExamples_connectArguments);&lt;BR /&gt;
    // (NOTE: Can throw HTTP 401 if bad credentials)&lt;BR /&gt;
$service-&amp;gt;login();&lt;/P&gt;

&lt;P&gt;Php 5.3.3. and Splunk 5.0.1&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:30:15 GMT</pubDate>
    <dc:creator>robsenk</dc:creator>
    <dc:date>2020-09-28T13:30:15Z</dc:date>
    <item>
      <title>Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57586#M776</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Login Failed.&lt;BR /&gt;
Reason: SSL: certificate subject name 'SplunkServerDefaultCert' does not match target host name 'my-other-server'&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If anybody can please advise on how to rid this error.  Prob. simple think i missed....&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2013 18:52:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57586#M776</guid>
      <dc:creator>robsenk</dc:creator>
      <dc:date>2013-03-11T18:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57587#M777</link>
      <description>&lt;P&gt;What version of PHP are you on?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2013 23:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57587#M777</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-03-11T23:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57588#M778</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2013 23:23:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57588#M778</guid>
      <dc:creator>robsenk</dc:creator>
      <dc:date>2013-03-11T23:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57589#M779</link>
      <description>&lt;P&gt;This error indicates that curl is failing due to an HTTPS certificate validation error. (curl is used by the PHP SDK when PHP &amp;lt;5.3.7 to fetch HTTP(S) URLs.)&lt;/P&gt;

&lt;P&gt;However the PHP SDK explicitly disables certificate validation in Http.php:159, so this error is rather unexpected:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;private function requestWithCurl(
...
        CURLOPT_SSL_VERIFYPEER =&amp;gt; FALSE,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;According to the PHP docs (&lt;A href="http://php.net/manual/en/function.curl-setopt.php" target="_blank"&gt;http://php.net/manual/en/function.curl-setopt.php&lt;/A&gt;), 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.&lt;/P&gt;

&lt;P&gt;Perhaps your curl is configured in some kind of strict mode that always performs certificate validation even when instructed not to?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:29:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57589#M779</guid>
      <dc:creator>davidfstr</dc:creator>
      <dc:date>2020-09-28T13:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57590#M780</link>
      <description>&lt;P&gt;Yes it does seem to be a curl issue.  I curl the page index page and disable ssl using the curl --insecure  --url&lt;MY url=""&gt;  and it still produces the error....  &lt;/MY&gt;&lt;/P&gt;

&lt;P&gt;Thanks for that help David&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 16:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57590#M780</guid>
      <dc:creator>robsenk</dc:creator>
      <dc:date>2013-03-12T16:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57591#M781</link>
      <description>&lt;P&gt;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.  &lt;/P&gt;

&lt;P&gt;$service = new Splunk_Service($SplunkExamples_connectArguments);&lt;BR /&gt;
    // (NOTE: Can throw HTTP 401 if bad credentials)&lt;BR /&gt;
$service-&amp;gt;login();&lt;/P&gt;

&lt;P&gt;Php 5.3.3. and Splunk 5.0.1&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57591#M781</guid>
      <dc:creator>robsenk</dc:creator>
      <dc:date>2020-09-28T13:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57592#M782</link>
      <description>&lt;P&gt;So are you seeing the same error or a different one? I would not expect the original error from a login failure.&lt;/P&gt;

&lt;P&gt;Also, your last message says that curl worked but the prior one said it did not. So I'm a bit confused.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 01:07:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57592#M782</guid>
      <dc:creator>davidfstr</dc:creator>
      <dc:date>2013-03-13T01:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57593#M783</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 23:47:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57593#M783</guid>
      <dc:creator>robsenk</dc:creator>
      <dc:date>2013-03-13T23:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57594#M784</link>
      <description>&lt;P&gt;The first time i mentioned it looked like a curl problem was not correct as I had  a problem in the URL.   My Bad.  So it looks like curl works fine from command line.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2013 19:40:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57594#M784</guid>
      <dc:creator>robsenk</dc:creator>
      <dc:date>2013-03-18T19:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find instructions to correct this problem with using the SDK examples for PHP</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57595#M785</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;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 =&amp;gt; TRUE,
             // disable SSL certificate validation
             CURLOPT_SSL_VERIFYPEER =&amp;gt; FALSE,
+            CURLOPT_SSL_VERIFYHOST =&amp;gt; FALSE,
         );

         foreach ($requestHeaders as $k =&amp;gt; $v)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I made the following patch to work around the issue.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 05:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Trying-to-find-instructions-to-correct-this-problem-with-using/m-p/57595#M785</guid>
      <dc:creator>netjunki</dc:creator>
      <dc:date>2014-11-11T05:55:34Z</dc:date>
    </item>
  </channel>
</rss>

