Skip to content

Commit

Permalink
patch requests methods to disable ssl verification
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechromancer committed Apr 2, 2022
1 parent edc6e63 commit cff6a7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions bbot/core/configurator/__init__.py
Expand Up @@ -25,3 +25,12 @@
if http_proxy:
os.environ["HTTP_PROXY"] = http_proxy
os.environ["HTTPS_PROXY"] = http_proxy

ssl_verify = config.get("ssl_verify", False)
if not ssl_verify:
import requests
import functools
requests.adapters.BaseAdapter.send = functools.partialmethod(requests.adapters.BaseAdapter.send, verify=False)
requests.adapters.HTTPAdapter.send = functools.partialmethod(requests.adapters.HTTPAdapter.send, verify=False)
requests.Session.request = functools.partialmethod(requests.Session.request, verify=False)
requests.request = functools.partial(requests.request, verify=False)
5 changes: 2 additions & 3 deletions bbot/core/helpers/misc.py
Expand Up @@ -16,9 +16,8 @@
log = logging.getLogger("bbot.core.helpers.misc")


def is_hostname(d):
r = event_type_regexes["DNS_NAME"]
if r.match(d):
def is_dns_name(d):
if event_type_regexes["DNS_NAME"].match(d):
return True
return False

Expand Down

0 comments on commit cff6a7b

Please sign in to comment.