feat(analyzer): do verify ssl certs on requests
BREAKING CHANGE: Analyzer no longer ignore certificate verification when performing a request. We recommand using Letsencrypt to get a certificat. If you do rely on self signed certificat, please read the requests documentation to provide a CA Bundle to verify the cert using environement variables.
This commit is contained in:
parent
a73dacc6b5
commit
8040d9a6c5
|
@ -118,9 +118,7 @@ def send_http_request(picklable_request, retry_queue):
|
||||||
bare_request = picklable_request.create_request()
|
bare_request = picklable_request.create_request()
|
||||||
s = requests.Session()
|
s = requests.Session()
|
||||||
prepared_request = s.prepare_request(bare_request)
|
prepared_request = s.prepare_request(bare_request)
|
||||||
r = s.send(
|
r = s.send(prepared_request, timeout=StatusReporter._HTTP_REQUEST_TIMEOUT)
|
||||||
prepared_request, timeout=StatusReporter._HTTP_REQUEST_TIMEOUT, verify=False
|
|
||||||
) # SNI is a pain in the ass
|
|
||||||
r.raise_for_status() # Raise an exception if there was an http error code returned
|
r.raise_for_status() # Raise an exception if there was an http error code returned
|
||||||
logger.info("HTTP request sent successfully.")
|
logger.info("HTTP request sent successfully.")
|
||||||
except requests.exceptions.HTTPError as e:
|
except requests.exceptions.HTTPError as e:
|
||||||
|
@ -163,7 +161,7 @@ def is_web_server_broken(url):
|
||||||
caused by Airtime or the webserver itself being broken temporarily.
|
caused by Airtime or the webserver itself being broken temporarily.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
test_req = requests.get(url, verify=False)
|
test_req = requests.get(url)
|
||||||
test_req.raise_for_status()
|
test_req.raise_for_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue