<?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: failed to connect using  client.connect in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382342#M6353</link>
    <description>&lt;P&gt;Hi @dvuichor,&lt;/P&gt;

&lt;P&gt;I think you should try 8089 management port. &lt;BR /&gt;
Can you please see example given in this link?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/DocumentationStatic/PythonSDK/1.1/client.html"&gt;http://docs.splunk.com/DocumentationStatic/PythonSDK/1.1/client.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9"&gt;http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 04 May 2018 08:39:55 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2018-05-04T08:39:55Z</dc:date>
    <item>
      <title>Getting error and connection failure using client.connect.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382341#M6352</link>
      <description>&lt;P&gt;here is my code:&lt;BR /&gt;
import splunklib.client as client&lt;/P&gt;

&lt;P&gt;HOST = "myhost"&lt;BR /&gt;
PORT = 8000&lt;BR /&gt;
USERNAME = "admin"&lt;BR /&gt;
PASSWORD = "mypassword"&lt;/P&gt;

&lt;H1&gt;Create a Service instance and log in&lt;/H1&gt;

&lt;P&gt;service = client.connect(&lt;BR /&gt;
    host=HOST,&lt;BR /&gt;
    port=PORT,&lt;BR /&gt;
    username=USERNAME,&lt;BR /&gt;
    password=PASSWORD)&lt;/P&gt;

&lt;P&gt;when i execute it failed with these errors&lt;/P&gt;

&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;
  File "testconn.py", line 13, in &lt;BR /&gt;
    password=PASSWORD)&lt;BR /&gt;
  File "/u01/software/splunk/software/splunk-sdk-python-1.6.3/splunklib/client.py", line 322, in connect&lt;BR /&gt;
    s.login()&lt;BR /&gt;
  File "/u01/software/splunk/software/splunk-sdk-python-1.6.3/splunklib/binding.py", line 859, in login&lt;BR /&gt;
    cookie="1") # In Splunk 6.2+, passing "cookie=1" will return the "set-cookie" header&lt;BR /&gt;
  File "/u01/software/splunk/software/splunk-sdk-python-1.6.3/splunklib/binding.py", line 1204, in post&lt;BR /&gt;
    return self.request(url, message)&lt;BR /&gt;
  File "/u01/software/splunk/software/splunk-sdk-python-1.6.3/splunklib/binding.py", line 1221, in request&lt;BR /&gt;
    response = self.handler(url, message, **kwargs)&lt;BR /&gt;
  File "/u01/software/splunk/software/splunk-sdk-python-1.6.3/splunklib/binding.py", line 1360, in request&lt;BR /&gt;
    connection.request(method, path, body, head)&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/httplib.py", line 1042, in request&lt;BR /&gt;
    self.&lt;EM&gt;send_request(method, url, body, headers)&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/httplib.py", line 1082, in _send_request&lt;BR /&gt;
    self.endheaders(body)&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/httplib.py", line 1038, in endheaders&lt;BR /&gt;
    self._send_output(message_body)&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/httplib.py", line 882, in _send_output&lt;BR /&gt;
    self.send(msg)&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/httplib.py", line 844, in send&lt;BR /&gt;
    self.connect()&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/httplib.py", line 1263, in connect&lt;BR /&gt;
    server_hostname=server_hostname)&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/ssl.py", line 363, in wrap_socket&lt;BR /&gt;
    _context=self)&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/ssl.py", line 611, in __init&lt;/EM&gt;_&lt;BR /&gt;
    self.do_handshake()&lt;BR /&gt;
  File "/u01/Anaconda/Anaconda25/lib/python2.7/ssl.py", line 840, in do_handshake&lt;BR /&gt;
    self._sslobj.do_handshake()&lt;BR /&gt;
ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:661)&lt;/P&gt;

&lt;P&gt;what did i do wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:25:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382341#M6352</guid>
      <dc:creator>dvuichor</dc:creator>
      <dc:date>2020-09-29T19:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: failed to connect using  client.connect</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382342#M6353</link>
      <description>&lt;P&gt;Hi @dvuichor,&lt;/P&gt;

&lt;P&gt;I think you should try 8089 management port. &lt;BR /&gt;
Can you please see example given in this link?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/DocumentationStatic/PythonSDK/1.1/client.html"&gt;http://docs.splunk.com/DocumentationStatic/PythonSDK/1.1/client.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9"&gt;http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 08:39:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382342#M6353</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-04T08:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: failed to connect using  client.connect</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382343#M6354</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
that fixed my issue&lt;/P&gt;

&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 16:29:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382343#M6354</guid>
      <dc:creator>dvuichor</dc:creator>
      <dc:date>2018-05-04T16:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: failed to connect using  client.connect</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382344#M6355</link>
      <description>&lt;P&gt;Hi @dvuichor,&lt;BR /&gt;
Great.&lt;BR /&gt;
Can you please accept the answer to close this question. This will help the community.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;!!!! Happy Splunking !!!!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 05:06:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382344#M6355</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-05T05:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: failed to connect using  client.connect</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382345#M6356</link>
      <description>&lt;P&gt;thanks for your help!&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 05:47:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382345#M6356</guid>
      <dc:creator>dvuichor</dc:creator>
      <dc:date>2018-05-05T05:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: failed to connect using  client.connect</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382346#M6357</link>
      <description>&lt;P&gt;I have the same issue. But, I used port 8089. But, I am still not able to connect. The error I get is:&lt;/P&gt;

&lt;P&gt;ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)&lt;/P&gt;

&lt;P&gt;The code is below for the connection I used. Please guide me on this.&lt;/P&gt;

&lt;P&gt;import splunklib.client as client&lt;/P&gt;

&lt;P&gt;HOST = "localhost"&lt;BR /&gt;
PORT = 8089&lt;BR /&gt;
USERNAME = "admin"&lt;BR /&gt;
PASSWORD = "Qwerty@1993"&lt;/P&gt;

&lt;P&gt;service = client.connect(&lt;BR /&gt;
host=HOST,&lt;BR /&gt;
port=PORT,&lt;BR /&gt;
username=USERNAME,&lt;BR /&gt;
password=PASSWORD)&lt;/P&gt;

&lt;P&gt;for app in service.apps:&lt;BR /&gt;
print app.name&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382346#M6357</guid>
      <dc:creator>chandrasekharko</dc:creator>
      <dc:date>2020-09-29T20:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: failed to connect using  client.connect</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382347#M6358</link>
      <description>&lt;P&gt;Hi @kamlesh_vaghela ,&lt;BR /&gt;
I am having the same issue as reported here, but i am using 8089 as a port, and my firewall is aswell down.&lt;BR /&gt;
I am even able to do a curl , but the script continues to give the same certificate error.&lt;/P&gt;

&lt;P&gt;Can you please suggest anything for this?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Shahid&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 07:12:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382347#M6358</guid>
      <dc:creator>shahid285</dc:creator>
      <dc:date>2019-08-30T07:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: failed to connect using  client.connect</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382348#M6359</link>
      <description>&lt;P&gt;@shahid285&lt;/P&gt;

&lt;P&gt;Not sure about your exact issue, So can you please refer below link for that?&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/609126/ssl-error-while-trying-to-connect-to-splunk-web-fr.html"&gt;https://answers.splunk.com/answers/609126/ssl-error-while-trying-to-connect-to-splunk-web-fr.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 07:48:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-error-and-connection-failure-using-client-connect/m-p/382348#M6359</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-08-30T07:48:12Z</dc:date>
    </item>
  </channel>
</rss>

