Splunk Dev

splunk-sdk-python-1.2.2 -> stop working after upgrading to Splunk 6.0 from Splunk 4.3

lpolo
Motivator

After upgrading to Splunk 6.X all our python scripts that use the latest version of splunk sdk “splunk-sdk-python-1.2.2” stop working. The error we constantly get is the following:

ssl.SSLError: [Errno 1] _ssl.c:492: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Has anyone faced this issue?
How did you solve it?

These are the connection parameters we used.

HOST = "myhost.com"
PORT = 8089
USERNAME = "myaccountid"
PASSWORD = "mypassword"
OWNER = "myaccountid"
APP = "search"

# Create a Service instance and log in
service = client.connect(
    host=HOST,
    port=PORT,
    username=USERNAME,
    password=PASSWORD,
    app=APP,
    owner=OWNER,
    )

After a couple of tests and reading the splunk sdk API. I realized that https scheme is the default in splunklib.client.connect. However, after the upgrade it looks like the splunk admin disabled the support of https. So the issue was solved as follow:

HOST = "myhost.com"
PORT = 8089
USERNAME = "myaccountid"
PASSWORD = "mypassword"
OWNER = "myaccountid"
SCHEME = "http"
APP = "search"

# Create a Service instance and log in
service = client.connect(
    host=HOST,
    port=PORT,
    username=USERNAME,
    password=PASSWORD,
    app=APP,
    owner=OWNER,
    scheme=SCHEME
    )
0 Karma

sloshburch
Ultra Champion

I've seen that before when non SSL forwarders try to connect to an SSL indexer (or vice versa - I forget which). The point is, I got that error message while working with basic splunk features, not even with the python SDK.

Anyway - I bet if you make sure everyone's talking the same thing (SSL or http) then you'll find the issue is resolved. Maybe the latest splunk defaults to SSL and the python code you have is still talking http? I'd also remove any sslPassword fields to force splunk to regen them...just for good measure.

0 Karma

i2sheri
Communicator

also when requireClientCert=true is enabled the service = client.connect() fails
any information on this ?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...