All Apps and Add-ons

Urllib error with Splunk 9.1.2

dave_null
Path Finder

Hello, this app was working fine for me until I updated to Splunk Enterprise 9.1.2, whereupon the urllib library keeps making errors where it does not understand HTTPS. From some rudimentary googling, it appears this may be related to the Splunk python urllib library not being compiled to use SSL. Would it be possible to refactor this app to use the http request helper functions?

 

 

 

 

 

 

bash-4.2$ /opt/splunk/bin/python3 getSplunkAppsV1.py
Traceback (most recent call last):
  File "getSplunkAppsV1.py", line 92, in <module>
    main()
  File "getSplunkAppsV1.py", line 87, in main
    for app_json in iterate_apps(app_func):
  File "getSplunkAppsV1.py", line 76, in iterate_apps
    data = get_apps(limit, offset, app_filter)
  File "getSplunkAppsV1.py", line 35, in get_apps
    data = json.load(urllib.request.urlopen(url))
  File "/opt/splunk/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/splunk/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/opt/splunk/lib/python3.7/urllib/request.py", line 548, in _open
    'unknown_open', req)
  File "/opt/splunk/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/opt/splunk/lib/python3.7/urllib/request.py", line 1420, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: https>

 

 

 

 

(The same error is produced when I use python version 2)

Labels (1)
0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...