<?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: How can I troubleshoot a socket connection error from python to Splunk? (SSL: CERTIFICATE_VERIFY_FAILED) in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159742#M2170</link>
    <description>&lt;P&gt;The problem was my python version install.&lt;BR /&gt;
It doesn't work with: Python 2.7.9 64bit and Python 2.7.9 32bit.&lt;BR /&gt;
It works with 2.7.8 32 Bit&lt;/P&gt;</description>
    <pubDate>Tue, 16 Dec 2014 16:33:24 GMT</pubDate>
    <dc:creator>manus</dc:creator>
    <dc:date>2014-12-16T16:33:24Z</dc:date>
    <item>
      <title>How can I troubleshoot a socket connection error from python to Splunk? (SSL: CERTIFICATE_VERIFY_FAILED)</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159741#M2169</link>
      <description>&lt;P&gt;I'm doing my first python script connecting to Splunk. It fails with following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Traceback (most recent call last):  
  File "PrintInterntalIndexEventCount.py", line 14, in &amp;lt;module&amp;gt;  
    password=PASSWORD,scheme=scheme)  
  File "C:\Python27\lib\site-packages\splunklib\client.py", line 305, in connect  
    return Service(**kwargs).login()   
  File "C:\Python27\lib\site-packages\splunklib\binding.py", line 761, in login   
    password=self.password)   
  File "C:\Python27\lib\site-packages\splunklib\binding.py", line 1090, in post  
    return self.request(url, message)   
  File "C:\Python27\lib\site-packages\splunklib\binding.py", line 1107, in request
    response = self.handler(url, message, **kwargs)
  File "C:\Python27\lib\site-packages\splunklib\binding.py", line 1225, in request
    connection.request(method, path, body, head)
  File "C:\Python27\lib\httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "C:\Python27\lib\httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "C:\Python27\lib\httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 850, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 812, in send
    self.connect()
  File "C:\Python27\lib\httplib.py", line 1216, in connect
    server_hostname=server_hostname)
  File "C:\Python27\lib\ssl.py", line 350, in wrap_socket
    _context=self)
  File "C:\Python27\lib\ssl.py", line 566, in __init__
    self.do_handshake()
  File "C:\Python27\lib\ssl.py", line 788, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is the script&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunklib.client as client

HOST = "lonsl1101443.uk.net.intra"
PORT = 8089
USERNAME = "user"
PASSWORD = "pwd"
scheme="https"

service = client.connect(
    host=HOST,
    port=PORT,
    username=USERNAME,
    password=PASSWORD,scheme=scheme)

for app in service.apps:
    print app.name  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If someone has the slightest idea about why this could fail, that would help!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 14:56:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159741#M2169</guid>
      <dc:creator>manus</dc:creator>
      <dc:date>2014-12-16T14:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I troubleshoot a socket connection error from python to Splunk? (SSL: CERTIFICATE_VERIFY_FAILED)</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159742#M2170</link>
      <description>&lt;P&gt;The problem was my python version install.&lt;BR /&gt;
It doesn't work with: Python 2.7.9 64bit and Python 2.7.9 32bit.&lt;BR /&gt;
It works with 2.7.8 32 Bit&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 16:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159742#M2170</guid>
      <dc:creator>manus</dc:creator>
      <dc:date>2014-12-16T16:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I troubleshoot a socket connection error from python to Splunk? (SSL: CERTIFICATE_VERIFY_FAILED)</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159743#M2171</link>
      <description>&lt;P&gt;Thank you, that was driving me crazy!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jan 2015 21:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159743#M2171</guid>
      <dc:creator>lasnow</dc:creator>
      <dc:date>2015-01-02T21:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I troubleshoot a socket connection error from python to Splunk? (SSL: CERTIFICATE_VERIFY_FAILED)</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159744#M2172</link>
      <description>&lt;P&gt;Thank you!  Good to know.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2015 15:53:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159744#M2172</guid>
      <dc:creator>etz</dc:creator>
      <dc:date>2015-01-08T15:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I troubleshoot a socket connection error from python to Splunk? (SSL: CERTIFICATE_VERIFY_FAILED)</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159745#M2173</link>
      <description>&lt;P&gt;The proxy in our network is failing to verify the host certificate and hence not able to establish handshake.&lt;BR /&gt;
After bypassing the host verification on the proxy we were able to connect to AWS endpoints.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 07:07:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-can-I-troubleshoot-a-socket-connection-error-from-python-to/m-p/159745#M2173</guid>
      <dc:creator>sylim_splunk</dc:creator>
      <dc:date>2016-06-21T07:07:49Z</dc:date>
    </item>
  </channel>
</rss>

