add 'downloader.http.verify' option

(also: change the default 'timeout' from None to 30)
This commit is contained in:
Mike Fährmann
2017-08-31 15:21:08 +02:00
parent 65997d835b
commit b8862ff15e
3 changed files with 38 additions and 12 deletions

View File

@@ -21,7 +21,8 @@ log = logging.getLogger("http")
class Downloader(BasicDownloader):
retries = config.interpolate(("downloader", "http", "retries",), 5)
timeout = config.interpolate(("downloader", "http", "timeout",), None)
timeout = config.interpolate(("downloader", "http", "timeout",), 30)
verify = config.interpolate(("downloader", "http", "verify",), True)
def __init__(self, session, output):
BasicDownloader.__init__(self)
@@ -42,7 +43,7 @@ class Downloader(BasicDownloader):
# try to connect to remote source
try:
response = self.session.get(
url, stream=True, timeout=self.timeout
url, stream=True, timeout=self.timeout, verify=self.verify,
)
except (rexcepts.ConnectionError, rexcepts.Timeout) as exception:
msg = exception