Simple Python Query Failure
I'm trying to use a python script to access a view in SumoLogic but it is failing with a bad handshake error. Can anyone see where I'm going wrong? I can't find an example on this forum, but if there is one please let me know!
My code:
import requests
url = 'https://api.eu.sumologic.com/api/v1/search/jobs'
proxy_user= '' #username removed
proxy_pass='' #password removed
proxy_host='' #host removed
proxy_url='http://'+proxy_user+':'+proxy_pass+'@'+proxy_host
proxies={
'http':proxy_url,
'https':proxy_url
}
sumo_id = '' #ID removed
sumo_key = '' #key removed
parameters = {
'query': '_view=view_name authenticated_session=1 | limit 1',
'from': '2021-01-26T00:00:01',
'to': '2021-01-26T23:59:59',
'timeZone': 'GB'
}
resp = requests.post(url, data=parameters, proxies=proxies, auth=(sumo_id,sumo_key))
resp.text
Error:
SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])",)
Thank you.
Please sign in to leave a comment.
Comments
0 comments