Commit 62b62ea4 authored by juga's avatar juga
Browse files

destination: add constant to verify destination

certificate by default.
parent c2b85b3f
...@@ -53,6 +53,8 @@ MAX_BW_DIFF_PERC = 50 ...@@ -53,6 +53,8 @@ MAX_BW_DIFF_PERC = 50
BW_LINE_SIZE = 510 BW_LINE_SIZE = 510
DESTINATION_VERIFY_CERTIFICATE = True
def fail_hard(*a, **kw): def fail_hard(*a, **kw):
''' Log something ... and then exit as fast as possible ''' ''' Log something ... and then exit as fast as possible '''
......
...@@ -6,6 +6,8 @@ from threading import RLock ...@@ -6,6 +6,8 @@ from threading import RLock
import requests import requests
from urllib.parse import urlparse from urllib.parse import urlparse
from stem.control import EventType from stem.control import EventType
from sbws.globals import DESTINATION_VERIFY_CERTIFICATE
import sbws.util.stem as stem_utils import sbws.util.stem as stem_utils
import sbws.util.requests as requests_utils import sbws.util.requests as requests_utils
...@@ -14,7 +16,7 @@ log = logging.getLogger(__name__) ...@@ -14,7 +16,7 @@ log = logging.getLogger(__name__)
def _parse_verify_option(conf_section): def _parse_verify_option(conf_section):
if 'verify' not in conf_section: if 'verify' not in conf_section:
return True return DESTINATION_VERIFY_CERTIFICATE
try: try:
return conf_section.getboolean('verify') return conf_section.getboolean('verify')
except ValueError: except ValueError:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment