Add global "insecure" option to skip SSL validation

closes #930
This commit is contained in:
Laurent Bachelier 2013-01-09 19:18:52 +01:00 committed by Romain Bignon
commit 8bc80db331
2 changed files with 6 additions and 1 deletions

View file

@ -173,6 +173,7 @@ class StandardBrowser(mechanize.Browser):
DEBUG_HTTP = False
DEBUG_MECHANIZE = False
DEFAULT_TIMEOUT = 15
INSECURE = False # if True, do not validate SSL
responses_dirname = None
responses_count = 0
@ -495,7 +496,7 @@ class BaseBrowser(StandardBrowser):
self.username = username
self.password = password
if self.CERTHASH is not None and self.DOMAIN is not None:
if not self.INSECURE and self.CERTHASH is not None and self.DOMAIN is not None:
self.lowsslcheck(self.DOMAIN, self.CERTHASH)
if self.password and get_home: