splunk / splunk/splunk-sdk-python

Search Result Export with SSL off doesn't work

未关闭
#828 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
743
派生
387
平均合并
42 分钟
30 天内合并 PR
4

描述

Describe the bug
When the [sslConfig] enableSplunkdSSL is set to false in server.conf, then export of search results fails, giving the following on-screen error:

Service Unavailable

This was working in the 9.* version, but has been broken in the 10.* version.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'server.conf' and set the [sslConfig] enableSplunkdSSL flag to false. Restart splunk server.
  2. Perform a search in the web search.
  3. Attempt to export the results using the down arrow.
  4. See error

Expected behavior
Results are exported

Logs or Screenshots
This log can be seen in web_service.log:

2026-08-18 06:50:23,399 ERROR	[6a8400af56192cc745880] __init__:874 - SSL error communicating with splunkd, error="[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1046)", path=/servicesNS/admin/search/search/v2/jobs/export
2026-08-18 06:50:23,399 ERROR	[6a8400af56192cc745880] decorators:413 - Splunkd daemon is not responding: ('SSL error communicating with splunkd, error="[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1046)", path=/servicesNS/admin/search/search/v2/jobs/export',)
Traceback (most recent call last):
  File "F:\Program Files\Splunk\Python-3.13\Lib\site-packages\splunk\rest\__init__.py", line 855, in streamingRequest
    conn.connect()
    ~~~~~~~~~~~~^^
  File "F:\Program Files\Splunk\Python-3.13\Lib\http\client.py", line 1499, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
                                          server_hostname=server_hostname)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\Program Files\Splunk\Python-3.13\Lib\ssl.py", line 460, in wrap_socket
    return self.sslsocket_class._create(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        sock=sock,
        ^^^^^^^^^^
    ...<5 lines>...
        session=session
        ^^^^^^^^^^^^^^^
    )
    ^
  File "F:\Program Files\Splunk\Python-3.13\Lib\ssl.py", line 1085, in _create
    self.do_handshake()
    ~~~~~~~~~~~~~~~~~^^
  File "F:\Program Files\Splunk\Python-3.13\Lib\ssl.py", line 1381, in do_handshake
    self._sslobj.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1046)

Splunk (please complete the following information):

  • Version: 10.4.1
  • OS: Windows
  • Deployment: Single Instance Enterprise

SDK (please complete the following information):

  • Version: As per install
  • Language Runtime Version: As per install
  • OS: As per install

Additional context
I think the problem is in Splunk\Python-3.13\Lib\site-packages\splunk\rest\__init__.py, when it goes to create the "conn" object for the connection, it has an if-else statement. In the "if" part of the statement, it has the "if isssl else httplib.HTTPConnection(host, port, timeout=timeout)" code which will create an HTTPConnection if ssl is not enabled. BUT in the "else" part of the if-else statement, it doesn't have that, so will always attempt to create an HTTPSConnection even if ssl is not enabled.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

Start in Splunk\Python-3.13\Lib\site-packages\splunk\rest_init_.py, around streamingRequest and the conn creation logic, then reproduce the export request with enableSplunkdSSL=false. Verify the connection uses the configured protocol and that search-result export succeeds without the WRONG_VERSION_NUMBER error.

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
描述清楚
新手友好度
74/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。