[tor-commits] [sbws/master] destination: add constant to verify destination
juga at torproject.org
juga at torproject.org
Fri Feb 15 17:40:52 UTC 2019
commit 62b62ea4e4722e8297e2cf88c01bb33ad08fb970
Author: juga0 <juga at riseup.net>
Date: Sat Dec 8 16:36:07 2018 +0000
destination: add constant to verify destination
certificate by default.
---
sbws/globals.py | 2 ++
sbws/lib/destination.py | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/sbws/globals.py b/sbws/globals.py
index 2277850..f4373b9 100644
--- a/sbws/globals.py
+++ b/sbws/globals.py
@@ -53,6 +53,8 @@ MAX_BW_DIFF_PERC = 50
BW_LINE_SIZE = 510
+DESTINATION_VERIFY_CERTIFICATE = True
+
def fail_hard(*a, **kw):
''' Log something ... and then exit as fast as possible '''
diff --git a/sbws/lib/destination.py b/sbws/lib/destination.py
index 1b4c192..94622ff 100644
--- a/sbws/lib/destination.py
+++ b/sbws/lib/destination.py
@@ -6,6 +6,8 @@ from threading import RLock
import requests
from urllib.parse import urlparse
from stem.control import EventType
+
+from sbws.globals import DESTINATION_VERIFY_CERTIFICATE
import sbws.util.stem as stem_utils
import sbws.util.requests as requests_utils
@@ -14,7 +16,7 @@ log = logging.getLogger(__name__)
def _parse_verify_option(conf_section):
if 'verify' not in conf_section:
- return True
+ return DESTINATION_VERIFY_CERTIFICATE
try:
return conf_section.getboolean('verify')
except ValueError:
More information about the tor-commits
mailing list