hRun / SA-haveibeenpwned

Splunk add-on providing a custom search command to query Troy Hunt's haveibeenpwned API (https://haveibeenpwned.com/api/v3/) for known breaches of your domains or mail addresses.
https://splunkbase.splunk.com/app/5050/
Apache License 2.0
6 stars 4 forks source link

Proxy connection Error #8

Closed skydandrear closed 1 year ago

skydandrear commented 1 year ago

Hi, we noticed that inside the python code (haveibeenpwned.py) when the connection is made through the proxy, the call is not executed because it lacks the call to the function r.read() that completes the call of the http_client and allows to execute a new request.

Here is the code: Line 156

150    if proxy_type == "http":
151              try:
152                        connection = http_client.HTTPSConnection('{0}'.format(proxy_url.split('//')[-1].rstrip('/')), port=proxy_port)
153                        connection.set_tunnel('haveibeenpwned.com', port=443, headers=auth_headers)
154                        connection.request('HEAD', '/api/v3', headers=headers)
155                        r = connection.getresponse()
156                        r.read()

This is one of the solutions we have set up.

Best regards,

Roberto and team

hRun commented 1 year ago

Hi Roberto and team,

Sorry for the late reply. You are of course entirely correct, I don't know how I missed this. Feel free to create a pull request with the fix to take credit. Otherwise, I'll publish a fix in the coming days.

Best regards, Harun